[DebugCounters] don't do redundant map lookups; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340104 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
George Burgess IV
2018-08-17 22:34:04 +00:00
parent 709fda6969
commit 68cedc8ad5
+8 -4
View File
@@ -83,8 +83,10 @@ void DebugCounter::push_back(const std::string &Val) {
return;
}
enableAllCounters();
Counters[CounterID].Skip = CounterVal;
Counters[CounterID].IsSet = true;
CounterInfo &Counter = Counters[CounterID];
Counter.Skip = CounterVal;
Counter.IsSet = true;
} else if (CounterPair.first.endswith("-count")) {
auto CounterName = CounterPair.first.drop_back(6);
unsigned CounterID = getCounterId(CounterName);
@@ -94,8 +96,10 @@ void DebugCounter::push_back(const std::string &Val) {
return;
}
enableAllCounters();
Counters[CounterID].StopAfter = CounterVal;
Counters[CounterID].IsSet = true;
CounterInfo &Counter = Counters[CounterID];
Counter.StopAfter = CounterVal;
Counter.IsSet = true;
} else {
errs() << "DebugCounter Error: " << CounterPair.first
<< " does not end with -skip or -count\n";