From 151f83db6d9bef3c6e399d66e4fe423fe5253672 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Mon, 23 Dec 2024 14:14:10 -0500 Subject: [PATCH] Using C++20 `[[unlikely]]` here would be excessive micro-optimization --- src/link/object.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/link/object.cpp b/src/link/object.cpp index 971a8b10..26308354 100644 --- a/src/link/object.cpp +++ b/src/link/object.cpp @@ -30,13 +30,11 @@ static std::vector> nodes; // Helper functions for reading object files -// Internal, DO NOT USE. -// For helper wrapper macros defined below, such as `tryReadLong` +// For internal use only by `tryReadLong` and `tryGetc`! #define tryRead(func, type, errval, vartype, var, file, ...) \ do { \ FILE *tmpFile = file; \ type tmpVal = func(tmpFile); \ - /* TODO: maybe mark the condition as `unlikely`; how to do that portably? */ \ if (tmpVal == (errval)) { \ errx(__VA_ARGS__, feof(tmpFile) ? "Unexpected end of file" : strerror(errno)); \ } \