Author: ion Date: Sun Oct 4 17:13:38 2015 New Revision: 69441
URL: http://svn.reactos.org/svn/reactos?rev=69441&view=rev Log: [NTOSKRNL]: Jerome _was_ nice enough to make our cells ordered (64222).
Modified: trunk/reactos/ntoskrnl/config/cmindex.c
Modified: trunk/reactos/ntoskrnl/config/cmindex.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmindex.c?r... ============================================================================== --- trunk/reactos/ntoskrnl/config/cmindex.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/config/cmindex.c [iso-8859-1] Sun Oct 4 17:13:38 2015 @@ -11,8 +11,6 @@ #include "ntoskrnl.h" #define NDEBUG #include "debug.h" - -#define SOMEONE_WAS_NICE_ENOUGH_TO_MAKE_OUR_CELLS_LEXICALLY_SORTED
/* GLOBALS *******************************************************************/
@@ -161,9 +159,7 @@ while (TRUE) { /* Choose next entry */ -#ifdef SOMEONE_WAS_NICE_ENOUGH_TO_MAKE_OUR_CELLS_LEXICALLY_SORTED i = ((High - Low) / 2) + Low; -#endif
/* Get the leaf cell and then the leaf itself */ LeafCell = Index->List[i]; @@ -193,7 +189,6 @@ goto Return; }
-#ifdef SOMEONE_WAS_NICE_ENOUGH_TO_MAKE_OUR_CELLS_LEXICALLY_SORTED /* Check for negative result */ if (Result < 0) { @@ -232,7 +227,6 @@ /* Update the base to this index, since we know it's not lower. */ Low = i; } -#endif } else { @@ -247,16 +241,6 @@
/* Release the leaf cell */ HvReleaseCell(Hive, LeafCell); - -#ifndef SOMEONE_WAS_NICE_ENOUGH_TO_MAKE_OUR_CELLS_LEXICALLY_SORTED - /* Go to the next index, and return failure if we reach the end */ - if (++i > High) - { - /* Return failure */ - *SubKey = HCELL_NIL; - return 0; - } -#endif }
/* Make sure we got here for the right reasons */ @@ -386,11 +370,7 @@
/* Get the upper bound and middle entry */ High = Index->Count - 1; -#ifdef SOMEONE_WAS_NICE_ENOUGH_TO_MAKE_OUR_CELLS_LEXICALLY_SORTED i = High / 2; -#else - i = 0; -#endif
/* Check if we don't actually have any entries */ if (!Index->Count) @@ -415,7 +395,6 @@ /* Check if we got lucky and found it */ if (!Result) return i;
-#ifdef SOMEONE_WAS_NICE_ENOUGH_TO_MAKE_OUR_CELLS_LEXICALLY_SORTED /* Check if the result is below us */ if (Result < 0) { @@ -435,14 +414,6 @@
/* Set the new index */ i = ((High - Low) / 2) + Low; -#else - if (++i > High) - { - /* Return failure */ - *SubKey = HCELL_NIL; - return 0; - } -#endif }
/* @@ -735,33 +706,6 @@ /* Check if this is another index root */ if (IndexRoot->Signature == CM_KEY_INDEX_ROOT) { - -#ifndef SOMEONE_WAS_NICE_ENOUGH_TO_MAKE_OUR_CELLS_LEXICALLY_SORTED - /* CmpFindSubKeyInRoot is useless for actually finding the correct leaf when keys are not sorted */ - LONG ii; - PCM_KEY_INDEX Leaf; - /* Loop through each leaf in the index root */ - for (ii=0; ii<IndexRoot->Count; ii++) - { - Leaf = HvGetCell(Hive, IndexRoot->List[ii]); - if (Leaf) - { - Found = CmpFindSubKeyInLeaf(Hive, Leaf, SearchName, &SubKey); - HvReleaseCell(Hive, IndexRoot->List[ii]); - if (Found & 0x80000000) - { - HvReleaseCell(Hive, CellToRelease); - return HCELL_NIL; - } - - if (SubKey != HCELL_NIL) - { - HvReleaseCell(Hive, CellToRelease); - return SubKey; - } - } - } -#endif /* Lookup the name in the root */ Found = CmpFindSubKeyInRoot(Hive, IndexRoot,