Browse Source

Make cold_threshold_ look used to fix warning

This field isn't used yet, but it will be in the future so we don't want
to remove it. This fixes the warning in the meantime.
Keith Smiley 6 năm trước cách đây
mục cha
commit
7db639f924

+ 5 - 1
src/google/protobuf/compiler/cpp/cpp_message.cc

@@ -521,7 +521,11 @@ class ColdChunkSkipper {
 // Tuning parameters for ColdChunkSkipper.
 // Tuning parameters for ColdChunkSkipper.
 const double kColdRatio = 0.005;
 const double kColdRatio = 0.005;
 
 
-bool ColdChunkSkipper::IsColdChunk(int chunk) { return false; }
+bool ColdChunkSkipper::IsColdChunk(int chunk) {
+  // Mark this variable as used until it is actually used
+  (void) cold_threshold_;
+  return false;
+}
 
 
 void ColdChunkSkipper::OnStartChunk(int chunk, int cached_has_bit_index,
 void ColdChunkSkipper::OnStartChunk(int chunk, int cached_has_bit_index,
                                     const std::string& from,
                                     const std::string& from,