Skip to content

Commit

Permalink
formatting.h: Clarify meaning of cursor in FormatOneChar
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrv committed Apr 5, 2024
1 parent 83359d6 commit e9b04fe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cpp/src/arrow/util/formatting.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ namespace detail {
ARROW_EXPORT extern const char digit_pairs[];

// Based on fmtlib's format_int class:
// Write digits from right to left into a stack allocated buffer
inline void FormatOneChar(char c, char** cursor) { *--*cursor = c; }
// Write digits from right to left into a stack allocated buffer.
// \pre *cursor points to the byte after the one that will be written.
// \post *cursor points to the byte that was written.
inline void FormatOneChar(char c, char** cursor) { *(--(*cursor)) = c; }

template <typename Int>
void FormatOneDigit(Int value, char** cursor) {
Expand Down

0 comments on commit e9b04fe

Please sign in to comment.