Skip to content

Commit

Permalink
Remove unnecessary if/else branch
Browse files Browse the repository at this point in the history
Co-authored-by: Sylvain Rabot <sylvain@abstraction.fr>
  • Loading branch information
benridley and sylr committed Jan 14, 2022
1 parent 331a818 commit 3b0836c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions timeinterval/timeinterval.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,13 +457,9 @@ func clamp(n, min, max int) int {

// ContainsTime returns true if the TimeInterval contains the given time, otherwise returns false.
func (tp TimeInterval) ContainsTime(t time.Time) bool {
var location *time.Location
if tp.TimeZone == nil {
location = time.UTC
} else {
location = tp.TimeZone.Location
if tp.TimeZone != nil {
t = t.In(tp.TimeZone.Location)
}
t = t.In(location)
if tp.Times != nil {
in := false
for _, validMinutes := range tp.Times {
Expand Down

0 comments on commit 3b0836c

Please sign in to comment.