Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jonny Schäfer
tubus
Commits
a8f3a265
Commit
a8f3a265
authored
Jan 04, 2016
by
Jonny Schäfer
Browse files
optimize code and description of videoIsYounger
parent
c0a0e705
Changes
1
Show whitespace changes
Inline
Side-by-side
video.go
View file @
a8f3a265
...
...
@@ -107,12 +107,10 @@ func (v *videoSort) Len() int {
return
len
(
v
.
slice
)
}
// videoIsYounger returns if young is younger than old
// videoIsYounger compares the given two videos and returns true if the release
// date of young is more recent than the release date of old
func
videoIsYounger
(
young
,
old
*
videoContainer
)
bool
{
if
videoDateToSeconds
(
young
.
date
)
<
videoDateToSeconds
(
old
.
date
)
{
return
true
}
return
false
return
videoDateToSeconds
(
young
.
date
)
<
videoDateToSeconds
(
old
.
date
)
}
// videoDateToSeconds calculates the number of past seconds since the given date
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment