diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2018-08-17 22:34:04 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2018-08-17 22:34:04 +0000 |
commit | 04df67e268eaf4c63b7fd0712b0c54a6db89c1cf (patch) | |
tree | 6021ba346d2afe269fca24eb0f23c25101d5445c /llvm/lib/Support/DebugCounter.cpp | |
parent | b111da14ada1c8bba8a1ce4ed903ffc66627646c (diff) | |
download | bcm5719-llvm-04df67e268eaf4c63b7fd0712b0c54a6db89c1cf.tar.gz bcm5719-llvm-04df67e268eaf4c63b7fd0712b0c54a6db89c1cf.zip |
[DebugCounters] don't do redundant map lookups; NFC
llvm-svn: 340104
Diffstat (limited to 'llvm/lib/Support/DebugCounter.cpp')
-rw-r--r-- | llvm/lib/Support/DebugCounter.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Support/DebugCounter.cpp b/llvm/lib/Support/DebugCounter.cpp index 9c12de0776a..9c8260dbe07 100644 --- a/llvm/lib/Support/DebugCounter.cpp +++ b/llvm/lib/Support/DebugCounter.cpp @@ -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"; |