Skip to content

Commit 4c4d45d

Browse files
committed
Add a transparent comparator to c_instructions to allow string_view lookups
1 parent 4b7661a commit 4c4d45d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libevmasm/Instruction.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ using namespace solidity;
2626
using namespace solidity::util;
2727
using namespace solidity::evmasm;
2828

29-
std::map<std::string, Instruction> const solidity::evmasm::c_instructions =
29+
std::map<std::string, Instruction, std::less<>> const solidity::evmasm::c_instructions =
3030
{
3131
{ "STOP", Instruction::STOP },
3232
{ "ADD", Instruction::ADD },

libevmasm/Instruction.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,6 @@ InstructionInfo instructionInfo(Instruction _inst, langutil::EVMVersion _evmVers
322322
bool isValidInstruction(Instruction _inst);
323323

324324
/// Convert from string mnemonic to Instruction type.
325-
extern const std::map<std::string, Instruction> c_instructions;
325+
extern const std::map<std::string, Instruction, std::less<>> c_instructions;
326326

327327
}

0 commit comments

Comments
 (0)