Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-baker committed Sep 11, 2024
1 parent 2d991f1 commit 0f9ce5f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/opcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,18 @@ spv_result_t spvOpcodeTableNameLookup(spv_target_env env,
// Lack of binary search really hurts here. There isn't an easy filter to
// apply before checking aliases since we need to handle promotion from
// vendor to KHR/EXT and KHR/EXT to core. It would require a sure-fire way
// of dropping suffices. Fortunately, most lookup are based on token value.
// of dropping suffices. Fortunately, most lookup are based on token
// value.
//
// If this was a binary search we could iterate between the lower and
// upper bounds.
if (entry.numAliases > 0) {
for (uint32_t aliasIndex = 0; aliasIndex < entry.numAliases; aliasIndex++) {
for (uint32_t aliasIndex = 0; aliasIndex < entry.numAliases;
aliasIndex++) {
// Skip Op prefix. Should this be encoded in the table instead?
const auto alias = entry.aliases[aliasIndex] + 2;
const size_t aliasLength = strlen(alias);
if (nameLength == aliasLength &&
!strncmp(name, alias, nameLength)) {
if (nameLength == aliasLength && !strncmp(name, alias, nameLength)) {
*pEntry = &entry;
return SPV_SUCCESS;
}
Expand Down

0 comments on commit 0f9ce5f

Please sign in to comment.