Remove an old hack from my menu system that upon closer inspection is no longer needed.

git-svn-id: https://svn.eduke32.com/eduke32@6186 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-06-17 11:42:04 +00:00
parent a10893d75f
commit b0d9e94004

View file

@ -3836,7 +3836,13 @@ static vec2_t Menu_TextSize(int32_t x, int32_t y, const MenuFont_t *font, const
static int32_t Menu_FindOptionBinarySearch(MenuOption_t *object, const int32_t query, size_t searchstart, size_t searchend) static int32_t Menu_FindOptionBinarySearch(MenuOption_t *object, const int32_t query, size_t searchstart, size_t searchend)
{ {
const size_t thissearch = (searchstart + searchend) / 2; const size_t thissearch = (searchstart + searchend) / 2;
const int32_t difference = ((object->options->optionValues == NULL && query < 0) ? object->options->numOptions-1 : query) - ((object->options->optionValues == NULL) ? (int32_t) thissearch : object->options->optionValues[thissearch]); const bool isIdentityMap = object->options->optionValues == NULL;
const int32_t destination = isIdentityMap ? (int32_t) thissearch : object->options->optionValues[thissearch];
const int32_t difference = query - destination;
Bassert(!isIdentityMap || query >= 0);
if (difference == 0) if (difference == 0)
return thissearch; return thissearch;