1
0
mirror of https://github.com/golang/go synced 2024-11-24 01:40:12 -07:00

time: remove unused parameter

lookupName is only called in one location, and one of the return
values is unused, so let's remove it.

Change-Id: I35e22c7ec611e8eb349deb4f0561e212f7d9de0b
Reviewed-on: https://go-review.googlesource.com/55232
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
This commit is contained in:
Kevin Burke 2017-08-13 19:49:27 -06:00 committed by Rob Pike
parent c8e9fd5db0
commit 6203a79b52
2 changed files with 5 additions and 5 deletions

View File

@ -1071,7 +1071,7 @@ func parse(layout, value string, defaultLocation, local *Location) (Time, error)
t := Date(year, Month(month), day, hour, min, sec, nsec, UTC) t := Date(year, Month(month), day, hour, min, sec, nsec, UTC)
// Look for local zone with the given offset. // Look for local zone with the given offset.
// If that zone was in effect at the given time, use it. // If that zone was in effect at the given time, use it.
offset, _, ok := local.lookupName(zoneName, t.unixSec()) offset, ok := local.lookupName(zoneName, t.unixSec())
if ok { if ok {
t.addSec(-int64(offset)) t.addSec(-int64(offset))
t.setLoc(local) t.setLoc(local)

View File

@ -223,7 +223,7 @@ func (l *Location) firstZoneUsed() bool {
// lookupName returns information about the time zone with // lookupName returns information about the time zone with
// the given name (such as "EST") at the given pseudo-Unix time // the given name (such as "EST") at the given pseudo-Unix time
// (what the given time of day would be in UTC). // (what the given time of day would be in UTC).
func (l *Location) lookupName(name string, unix int64) (offset int, isDST bool, ok bool) { func (l *Location) lookupName(name string, unix int64) (offset int, ok bool) {
l = l.get() l = l.get()
// First try for a zone with the right name that was actually // First try for a zone with the right name that was actually
@ -235,9 +235,9 @@ func (l *Location) lookupName(name string, unix int64) (offset int, isDST bool,
for i := range l.zone { for i := range l.zone {
zone := &l.zone[i] zone := &l.zone[i]
if zone.name == name { if zone.name == name {
nam, offset, isDST, _, _ := l.lookup(unix - int64(zone.offset)) nam, offset, _, _, _ := l.lookup(unix - int64(zone.offset))
if nam == zone.name { if nam == zone.name {
return offset, isDST, true return offset, true
} }
} }
} }
@ -246,7 +246,7 @@ func (l *Location) lookupName(name string, unix int64) (offset int, isDST bool,
for i := range l.zone { for i := range l.zone {
zone := &l.zone[i] zone := &l.zone[i]
if zone.name == name { if zone.name == name {
return zone.offset, zone.isDST, true return zone.offset, true
} }
} }