From: Russ Combs (rucombs) Date: Thu, 10 Dec 2015 20:15:41 +0000 (-0500) Subject: Merge pull request #188 in SNORT/snort3 from ~JOCORNET/snort3:profiler_count_quickfix... X-Git-Tag: 3.0.0-233~681 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7d4e06f707e443b4d2bce919964d8d0cafd72452;p=thirdparty%2Fsnort3.git Merge pull request #188 in SNORT/snort3 from ~JOCORNET/snort3:profiler_count_quickfix to master Squashed commit of the following: commit c64b656a4cdea55fb939cf00355165e6f23327f6 Author: Joel Cornett Date: Thu Dec 10 15:11:18 2015 -0500 fixed bug which printed all stats regardless of count config --- diff --git a/src/profiler/profiler_printer.h b/src/profiler/profiler_printer.h index 82073dd48..ca249e879 100644 --- a/src/profiler/profiler_printer.h +++ b/src/profiler/profiler_printer.h @@ -104,10 +104,10 @@ public: if ( sort ) std::partial_sort(entries.begin(), entries.begin() + count, entries.end(), sort); - unsigned i = 0; - for ( auto& entry : entries ) + for ( unsigned i = 0; i < count; ++i ) { - print_row(root, entry, layer + 1, ++i); + auto& entry = entries[i]; + print_row(root, entry, layer + 1, i + 1); print_children(root, entry, layer + 1, count); } }