mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 18:43:38 +08:00
Merge pull request #3909 from humzashah/reduced-time-operation
reused value of `Time.now` in a method
This commit is contained in:
commit
6577f3c1ed
|
@ -1,8 +1,12 @@
|
|||
module AgeWords
|
||||
|
||||
def self.age_words(secs)
|
||||
return "—" if secs.blank?
|
||||
return FreedomPatches::Rails4.distance_of_time_in_words(Time.now, Time.now + secs)
|
||||
if secs.blank?
|
||||
"—"
|
||||
else
|
||||
now = Time.now
|
||||
FreedomPatches::Rails4.distance_of_time_in_words(now, now + secs)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user