mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +00:00
Fix an off-by-one error
This commit is contained in:
parent
0f6500cf2d
commit
9bebea8225
1 changed files with 1 additions and 1 deletions
|
|
@ -19,7 +19,7 @@ struct Month: Equatable {
|
||||||
let number: Int
|
let number: Int
|
||||||
|
|
||||||
init?(_ number: Int) {
|
init?(_ number: Int) {
|
||||||
guard number < Month.all.count else {
|
guard (1 ... Month.all.count).contains(number) else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
self.number = number
|
self.number = number
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue