@@ -13,7 +13,9 @@ void SearchController::onAllFiles() {
1313
1414 utils::recurseDir ( opts.path .native (), [&pool, this ]( const sys_string & filename ) {
1515 pool.add ( [filename, this ] {
16+ #if DETAILED_STATS
1617 stats.filesSearched ++;
18+ #endif
1719 search ( filename );
1820 } );
1921 } );
@@ -30,7 +32,9 @@ void SearchController::onGitFiles() {
3032
3133 utils::gitLsFiles ( opts.path , [&pool, this ]( const sys_string & filename ) {
3234 pool.add ( [filename, this ] {
35+ #if DETAILED_STATS
3336 stats.filesSearched ++;
37+ #endif
3438 search ( filename );
3539 } );
3640 } );
@@ -50,6 +54,7 @@ void SearchController::printGitHeader() {
5054 }
5155}
5256
57+ #if DETAILED_STATS
5358void SearchController::printStats () {
5459 if ( !opts.piped ) {
5560 utils::printColor ( gray, utils::format (
@@ -74,6 +79,7 @@ void SearchController::printFooter( const StopWatch::ns_type& ms ) {
7479 ms ) );
7580 }
7681}
82+ #endif
7783
7884void SearchController::search ( const sys_string& path ) {
7985
@@ -87,7 +93,9 @@ void SearchController::search( const sys_string& path ) {
8793 utils::FileView view = utils::fromWinAPI ( path );
8894#endif
8995
96+ #if DETAILED_STATS
9097 stats.bytesRead += view.size ;
98+ #endif
9199 STOP ( stats.t_read )
92100
93101 if ( !view.size ) { return ; }
@@ -103,8 +111,10 @@ void SearchController::search( const sys_string& path ) {
103111
104112 // handle matches
105113 if ( !matches.empty () ) {
114+ #if DETAILED_STATS
106115 stats.filesMatched ++;
107116 stats.matches += matches.size ();
117+ #endif
108118
109119 START
110120 static thread_local std::unique_ptr<Printer> printer ( makePrinter () );
0 commit comments