Skip to content

Commit

Permalink
rename 'content' variable to avoid duplicates (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
hliu18 authored Oct 16, 2023
1 parent c47b3ac commit 720c45c
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/pq_flash_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,8 @@ int PQFlashIndex<T, LabelT>::load_from_separate_paths(uint32_t num_threads, cons
#ifdef EXEC_ENV_OLS
if (files.fileExists(labels_file))
{
FileContent &content = files.getContent(labels_file);
std::stringstream infile(std::string((const char *)content._content, content._size));
FileContent &content_labels = files.getContent(labels_file);
std::stringstream infile(std::string((const char *)content_labels._content, content_labels._size));
#else
if (file_exists(labels_file))
{
Expand All @@ -798,8 +798,8 @@ int PQFlashIndex<T, LabelT>::load_from_separate_paths(uint32_t num_threads, cons
#endif

#ifdef EXEC_ENV_OLS
FileContent &content = files.getContent(labels_map_file);
std::stringstream map_reader(std::string((const char *)content._content, content._size));
FileContent &content_labels_map = files.getContent(labels_map_file);
std::stringstream map_reader(std::string((const char *)content_labels_map._content, content_labels_map._size));
#else
std::ifstream map_reader(labels_map_file);
#endif
Expand All @@ -812,8 +812,9 @@ int PQFlashIndex<T, LabelT>::load_from_separate_paths(uint32_t num_threads, cons
#ifdef EXEC_ENV_OLS
if (files.fileExists(labels_to_medoids))
{
FileContent &content = files.getContent(labels_to_medoids);
std::stringstream medoid_stream(std::string((const char *)content._content, content._size));
FileContent &content_labels_to_meoids = files.getContent(labels_to_medoids);
std::stringstream medoid_stream(
std::string((const char *)content_labels_to_meoids._content, content_labels_to_meoids._size));
#else
if (file_exists(labels_to_medoids))
{
Expand Down Expand Up @@ -852,8 +853,9 @@ int PQFlashIndex<T, LabelT>::load_from_separate_paths(uint32_t num_threads, cons
#ifdef EXEC_ENV_OLS
if (files.fileExists(univ_label_file))
{
FileContent &content = files.getContent(univ_label_file);
std::stringstream universal_label_reader(std::string((const char *)content._content, content._size));
FileContent &content_univ_label = files.getContent(univ_label_file);
std::stringstream universal_label_reader(
std::string((const char *)content_univ_label._content, content_univ_label._size));
#else
if (file_exists(univ_label_file))
{
Expand All @@ -872,8 +874,9 @@ int PQFlashIndex<T, LabelT>::load_from_separate_paths(uint32_t num_threads, cons
#ifdef EXEC_ENV_OLS
if (files.fileExists(dummy_map_file))
{
FileContent &content = files.getContent(dummy_map_file);
std::stringstream dummy_map_stream(std::string((const char *)content._content, content._size));
FileContent &content_dummy_map = files.getContent(dummy_map_file);
std::stringstream dummy_map_stream(
std::string((const char *)content_dummy_map._content, content_dummy_map._size));
#else
if (file_exists(dummy_map_file))
{
Expand Down

0 comments on commit 720c45c

Please sign in to comment.