Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
binary-search: Use error object instead of sentinel -1 (#1338)
binary-search 1.2.0 As discussed in #1312 Although -1 is a sentinel value, using this sentinel value is not the usual course of action in some languages. In using an error object, we avoid giving the wrong idea that we are requiring the use of the sentinel value. This error value was defined in #401 Of course, languages that wish to use a sentinel value may continue to do so; this commit is not intended to decree that sentinel values are forbidden. Neither is this commit decreeing that all languages must represent this condition as an error; it is simply a declaration that this condition bears enough consideration that we'll represent it with a different type. Closes #1312 Checks the related box in #1311
- Loading branch information