Closes #28
This commit is contained in:
1 parent
a0938cb29c
commit
3dd9230fca
21 files changed
+491
-450
No files matched your search
@@ -11,7 +11,7 @@ using RawSignalValue = std::variant<std::int64_t, std::uint64_t>;
|
||||
|
||||
/** Canonical keys: negative int64_t, nonnegative uint64_t. */
|
||||
inline RawSignalValue NormalizeValueKey(const RawSignalValue &value) {
|
||||
if (const auto *number = std::get_if<std::int64_t>(&value)) {
|
||||
if (const std::int64_t *number = std::get_if<std::int64_t>(&value)) {
|
||||
if (*number >= 0)
|
||||
return static_cast<std::uint64_t>(*number);
|
||||
}
|
||||
@@ -23,7 +23,7 @@ using ValueDescriptions = std::map<RawSignalValue, std::string>;
|
||||
/** Returns a borrowed string, or nullptr; never converts integers to double. */
|
||||
inline const std::string *FindValueDescription(const ValueDescriptions &descriptions,
|
||||
const RawSignalValue &rawValue) {
|
||||
const auto found = descriptions.find(NormalizeValueKey(rawValue));
|
||||
const ValueDescriptions::const_iterator found = descriptions.find(NormalizeValueKey(rawValue));
|
||||
return found == descriptions.end() ? nullptr : &found->second;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user