Skip to content

Commit

Permalink
Correct verbose example comparing data ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
jgarber623-cargosense authored Jun 14, 2024
1 parent 9c80461 commit a0d9eaa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ The above code is verbose, somewhat hard to read, and potentially incorrect (tho
Date.compare(start_date, date) != :gt and
Date.compare(date, end_date) != :gt

# …or, terser but less performant:
Date.compare(start_date, date) in [:lt, :eq]
# …or, even more verbosely:
Date.compare(start_date, date) in [:lt, :eq] and
Date.compare(date, end_date) in [:lt, :eq]
```

To spot the difference between these two cases, you must keep in mind:
Expand Down

0 comments on commit a0d9eaa

Please sign in to comment.