protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Readability fixes

Open haberman opened this issue 4 years ago • 3 comments

Once the current batch of work is landed in upb, we should make some sweeping readability fixes:

Rename APIs to be more readable

  • before: upb_extrange
  • after: upb_ExtensionRange

Avoid side-effects in ternaries

  • before: return upb_strtable_lookup2(&s->syms, sym, size, &v) ? unpack_def(v, type) : NULL
  • after: if (upb_strtable_lookup2(&s->syms, sym, size, &v)) { return unpack_def(v, type) } else { return NULL; }

Make range bounds use a consistent direction

  • before: UPB_ASSERT(i >= 0 && i < m->ext_range_count);
  • after: UPB_ASSERT(0 <= i && i < m->ext_range_count);

haberman avatar Oct 03 '21 02:10 haberman

cc @fowles

haberman avatar Oct 03 '21 02:10 haberman

Use markdown in doc comments

  • before: Returns the square root of |n|.
  • after: Returns the square root of `n\`.

haberman avatar Dec 06 '21 21:12 haberman

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago.

github-actions[bot] avatar Feb 17 '24 10:02 github-actions[bot]

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.

This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.

github-actions[bot] avatar Mar 02 '24 10:03 github-actions[bot]