Closed Dwarfex closed 3 years ago
I noticed that the data representation of a Document::class is sorted everytime a read access happens on the object. For performance reasons, the sorting of the (product-) data (-array) should happen with a set/write into the object.
https://github.com/openfoodfacts/openfoodfacts-php/blob/49808014d335af6dbac3162effc85e4f460d9e39/src/Document.php#L57
I noticed that the data representation of a Document::class is sorted everytime a read access happens on the object. For performance reasons, the sorting of the (product-) data (-array) should happen with a set/write into the object.
https://github.com/openfoodfacts/openfoodfacts-php/blob/49808014d335af6dbac3162effc85e4f460d9e39/src/Document.php#L57