in resolution of [Wsign-compare] warning id 9

Static cast  `int index` for the sake of the single `size_t` to `int` comparison on line 116.
This commit is contained in:
tg-at-google 2020-06-02 11:07:21 -04:00 committed by GitHub
parent 4f0fc47dd2
commit 251db72cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -113,7 +113,7 @@ SubAllocator* AllocatorFactoryRegistry::GetSubAllocator(int numa_node) {
CHECK_LE(numa_node, port::NUMANumNodes());
index = 1 + numa_node;
}
if (best_entry->sub_allocators.size() < (index + 1)) {
if (best_entry->sub_allocators.size() < static_cast<size_t>(index + 1)) {
best_entry->sub_allocators.resize(index + 1);
}
if (!best_entry->sub_allocators[index].get()) {