Skip to content

Commit

Permalink
remove unused code (#3371)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #3371

This will never happen because N is fixed at compile time and the buffer is large enough. It is misleading to add error handling code for a case that will never happen.

Reviewed By: kuarora

Differential Revision: D56274458

fbshipit-source-id: ca706f1223dbc97e69d5ac9750b277afa4df80a7
  • Loading branch information
junjieqi authored and facebook-github-bot committed Apr 22, 2024
1 parent 3677ab5 commit 5893ab7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions faiss/utils/simdlib_neon.h
Expand Up @@ -170,14 +170,10 @@ static inline std::string elements_to_string(const char* fmt, const S& simd) {
for (size_t i = 0; i < N; ++i) {
int bytesWritten =
snprintf(ptr, sizeof(res) - (ptr - res), fmt, bytes[i]);
if (bytesWritten >= 0) {
ptr += bytesWritten;
} else {
break;
}
ptr += bytesWritten;
}
// strip last ,

// The format usually contains a ',' separator so this is to remove the last
// separator.
ptr[-1] = 0;
return std::string(res);
}
Expand Down

0 comments on commit 5893ab7

Please sign in to comment.