Fix -Werror=type-limits seen in Travis (#9128)

Summary:
Work around annoying compiler warning-as-error from https://github.com/facebook/rocksdb/issues/9113

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9128

Test Plan: CI

Reviewed By: jay-zhuang

Differential Revision: D32181499

Pulled By: pdillinger

fbshipit-source-id: d7e5f7857a29f7ba47c49c3aee7150b5763b65d9
This commit is contained in:
Peter Dillinger 2021-11-04 14:59:37 -07:00 committed by Facebook GitHub Bot
parent 1ababeb76a
commit 2a3511a0df

View File

@ -31,7 +31,10 @@ std::vector<CompressionType> GetSupportedDictCompressions();
std::vector<ChecksumType> GetSupportedChecksums();
inline bool IsSupportedChecksumType(ChecksumType type) {
return type >= kNoChecksum && type <= kXXH3;
// Avoid annoying compiler warning-as-error (-Werror=type-limits)
auto min = kNoChecksum;
auto max = kXXH3;
return type >= min && type <= max;
}
// Checks that the combination of DBOptions and ColumnFamilyOptions are valid