Fixed a compile error in util/options_builder.cc

Summary:
Fixed the following compile error by replacing pow by shift, as it computes
power of 2.

util/options_builder.cc:133:14: error: no member named 'pow' in namespace 'std'
        std::pow(2, std::max(0, std::min(3, level0_stop_writes_trigger -
        ~~~~~^
1 error generated.
make: *** [util/options_builder.o] Error 1

Test Plan: make success in mac and linux

Reviewers: ljin, igor, sdong

Reviewed By: sdong

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D20475
This commit is contained in:
Yueh-Hsuan Chiang 2014-07-23 10:31:32 -07:00
parent 0e1b4787ed
commit 00f56dfa28

View File

@ -130,8 +130,8 @@ void OptimizeForLevel(int read_amplification_threshold,
// Try to enlarge the buffer up to 1GB, if still have sufficient headroom.
file_num_buffer *=
std::pow(2, std::max(0, std::min(3, level0_stop_writes_trigger -
file_num_buffer - 2)));
1 << std::max(0, std::min(3, level0_stop_writes_trigger -
file_num_buffer - 2));
options->level0_stop_writes_trigger = level0_stop_writes_trigger;
options->level0_slowdown_writes_trigger = level0_stop_writes_trigger - 2;