csams / garbagecat

Automatically exported from code.google.com/p/garbagecat
0 stars 0 forks source link

GCUtil.dateDiff() creates unnecessary callendar object in each call #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
v 1.0.0
This is not a bug. Small improvement
In  the GCUtil.dateDiff()in Calendar.getInstance() the Calendar object is being 
created in each call. And this happens very often.
I propose simplified version of dateDiff() method as follows

--------------------------------------------

public static final long dateDiff(Date start, Date end) {
        return end.getTime()-start.getTime();
    }

-------------------------------------------------------

Original issue reported on code.google.com by jbor...@gmail.com on 27 Apr 2011 at 8:27

GoogleCodeExporter commented 8 years ago
Ah, yes, much better.

Original comment by mgm...@gmail.com on 6 May 2011 at 6:52

GoogleCodeExporter commented 8 years ago
This was fixed a while ago, but the Issue wasn't marked as closed.

Original comment by d...@sunsetutopia.com on 7 Sep 2012 at 5:25