@@ -223,14 +223,14 @@ contract DiamondLoupeFacet {
223223 /// - This design is optimized for diamonds with many facets and many selectors,
224224 /// where the original O(n²) nested loop approach becomes prohibitively expensive.
225225 ///
226- /// @return facetsAndSelectors Array of Facet structs, each containing a facet address.
226+ /// @return facetsAndSelectors Array of Facet structs, each containing a facet address and function selectors .
227227 function facets () external view returns (Facet[] memory facetsAndSelectors ) {
228228 DiamondStorage storage s = getStorage ();
229229 bytes4 [] memory selectors = s.selectors;
230230 uint256 selectorsCount = selectors.length ;
231231 bytes4 selector;
232232
233- // Reuse the selectors array to hold pointers to Facet structs in memory.
233+ // Reuse the selectors memory array to hold pointers to Facet structs in memory.
234234 // Each pointer is a memory address to a Facet struct in memory.
235235 // As we loop through the selectors, we overwrite earlier slots with pointers.
236236 // The selectors array and the facetPointers array point to the same
@@ -250,6 +250,7 @@ contract DiamondLoupeFacet {
250250 // Each entry is a dynamically sized array of uint256 pointers.
251251 // Using only the last byte of the address (256 possible values) provides a simple
252252 // bucketing mechanism to reduce linear search costs across unique facets.
253+ // Each entry in the map is called a "bucket".
253254 uint256 [][256 ] memory map;
254255
255256 // The last byte of a facet address, used as an index key into `map`.
0 commit comments