Skip to content

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
AntiTopQuark committed Nov 5, 2024
1 parent e912d3e commit 2455a1c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,14 @@ bool StatusIsOK(const T& v) {
std::forward<decltype(status)>(status); \
}))

// NOLINTNEXTLINE
#define RETURN_IF_ERROR(...) \
({ \
auto&& status = (__VA_ARGS__); \
if (!StatusIsOK(status)) return std::forward<decltype(status)>(status); \
})

// NOLINTNEXTLINE
#define RETURN_IF_ERR_FROM_ROCKSDB(s, code, msg) \
({ \
if (!s.ok()) return Status(code, msg); \
Expand Down

0 comments on commit 2455a1c

Please sign in to comment.