]> Cypherpunks repositories - gostls13.git/commitdiff
time: remove unused parameter
authorKevin Burke <kev@inburke.com>
Mon, 14 Aug 2017 01:49:27 +0000 (19:49 -0600)
committerRob Pike <r@golang.org>
Mon, 14 Aug 2017 02:22:20 +0000 (02:22 +0000)
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>

src/time/format.go
src/time/zoneinfo.go

index b0f8806984dfe5f78d202cd0702dff1d19827ce8..c960df01978c5a98c4216c5543453cedd0869d9e 100644 (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)
                // Look for local zone with the given offset.
                // 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 {
                        t.addSec(-int64(offset))
                        t.setLoc(local)
index f4d4df95d36446bf314998b637b7a723bbe4dd67..09687fd0adfd8f4020dd40de7ef37bc19078d235 100644 (file)
@@ -223,7 +223,7 @@ func (l *Location) firstZoneUsed() bool {
 // lookupName returns information about the time zone with
 // the given name (such as "EST") at the given pseudo-Unix time
 // (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()
 
        // 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 {
                zone := &l.zone[i]
                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 {
-                               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 {
                zone := &l.zone[i]
                if zone.name == name {
-                       return zone.offset, zone.isDST, true
+                       return zone.offset, true
                }
        }