Skip to content

Commit 0bd956f

Browse files
junjieqifacebook-github-bot
authored andcommitted
remove unused code (#3371)
Summary: 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
1 parent 3677ab5 commit 0bd956f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

faiss/utils/simdlib_neon.h

+3-7
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,10 @@ static inline std::string elements_to_string(const char* fmt, const S& simd) {
170170
for (size_t i = 0; i < N; ++i) {
171171
int bytesWritten =
172172
snprintf(ptr, sizeof(res) - (ptr - res), fmt, bytes[i]);
173-
if (bytesWritten >= 0) {
174-
ptr += bytesWritten;
175-
} else {
176-
break;
177-
}
173+
ptr += bytesWritten;
178174
}
179-
// strip last ,
180-
175+
// The format usually contains a ',' separator so this is to remove the last
176+
// separator.
181177
ptr[-1] = 0;
182178
return std::string(res);
183179
}

0 commit comments

Comments
 (0)