guard clause
A check at the top of a method that returns early for an input the rest can't handle.
Examples
if (items.isEmpty()) return 0;at the top of a method, before the main work.
See also
A check at the top of a method that returns early for an input the rest can't handle.
Examples
if (items.isEmpty()) return 0; at the top of a method, before the main work.
See also