]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #188 in SNORT/snort3 from ~JOCORNET/snort3:profiler_count_quickfix...
authorRuss Combs (rucombs) <rucombs@cisco.com>
Thu, 10 Dec 2015 20:15:41 +0000 (15:15 -0500)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Thu, 10 Dec 2015 20:15:41 +0000 (15:15 -0500)
Squashed commit of the following:

commit c64b656a4cdea55fb939cf00355165e6f23327f6
Author: Joel Cornett <joel.cornett@gmail.com>
Date:   Thu Dec 10 15:11:18 2015 -0500

    fixed bug which printed all stats regardless of count config

src/profiler/profiler_printer.h

index 82073dd48e4f9ae9c9b296df845559fe96160c73..ca249e8790a6eb71961a296d9a75113b8a672353 100644 (file)
@@ -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);
         }
     }