1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Remove redundant Unix timestamp method call

Unix() already uses UTC as timezone
This commit is contained in:
Unknwon
2016-07-23 20:24:44 +08:00
parent 4e822c1911
commit 250be011c7
13 changed files with 38 additions and 38 deletions

View File

@@ -64,13 +64,13 @@ type Issue struct {
}
func (i *Issue) BeforeInsert() {
i.CreatedUnix = time.Now().UTC().Unix()
i.CreatedUnix = time.Now().Unix()
i.UpdatedUnix = i.CreatedUnix
}
func (i *Issue) BeforeUpdate() {
i.UpdatedUnix = time.Now().UTC().Unix()
i.DeadlineUnix = i.Deadline.UTC().Unix()
i.UpdatedUnix = time.Now().Unix()
i.DeadlineUnix = i.Deadline.Unix()
}
func (issue *Issue) loadAttributes(e Engine) (err error) {
@@ -1046,7 +1046,7 @@ type Milestone struct {
}
func (m *Milestone) BeforeInsert() {
m.DeadlineUnix = m.Deadline.UTC().Unix()
m.DeadlineUnix = m.Deadline.Unix()
}
func (m *Milestone) BeforeUpdate() {
@@ -1056,8 +1056,8 @@ func (m *Milestone) BeforeUpdate() {
m.Completeness = 0
}
m.DeadlineUnix = m.Deadline.UTC().Unix()
m.ClosedDateUnix = m.ClosedDate.UTC().Unix()
m.DeadlineUnix = m.Deadline.Unix()
m.ClosedDateUnix = m.ClosedDate.Unix()
}
func (m *Milestone) AfterSet(colName string, _ xorm.Cell) {
@@ -1361,7 +1361,7 @@ type Attachment struct {
}
func (a *Attachment) BeforeInsert() {
a.CreatedUnix = time.Now().UTC().Unix()
a.CreatedUnix = time.Now().Unix()
}
func (a *Attachment) AfterSet(colName string, _ xorm.Cell) {