Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use CHECK* macros to replace assert macros #1204

Open
6 of 7 tasks
acelyc111 opened this issue Oct 26, 2022 · 1 comment
Open
6 of 7 tasks

refactor: use CHECK* macros to replace assert macros #1204

acelyc111 opened this issue Oct 26, 2022 · 1 comment

Comments

@acelyc111
Copy link
Member

acelyc111 commented Oct 26, 2022

This refactor work contains the following motivations:

  1. macros are offen recommend to use all upper case.
  2. the beginning char 'd' is easy to misunderstand as 'only enable in Debug version'
  3. there are 2 styles, dassert_f and dassert, we can unify them
  • replace dassert which check a single condition
  • replace dcheck_eq*
  • replace dcheck_ge*
  • replace dcheck_le*
  • replace dcheck_gt*
  • replace dcheck_lt*
  • remove danling-else CHECK(false, ...)
@acelyc111
Copy link
Member Author

TODO

There are some code like

if (a) {
  // do sth
} else {
  CHECK(false, ...);
}

can be improved by

CHECK(a, ...)
// do sth

@acelyc111 acelyc111 reopened this Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant