* Matthew Toseland <toad at amphibian.dyndns.org> [2007-12-03 14:24:07]:
> 1L* ? That's also redundant, just put the L on the 1000, or the 7.
>
Imho it's clearer code-wise... so that if someone changes the value it
*will* be clear for him that it's meant to be casted into a long.
Arguably noone will ever touch that method again.
> On Monday 03 December 2007 14:19, nextgens at freenetproject.org wrote:
> > Author: nextgens
> > Date: 2007-12-03 14:19:43 +0000 (Mon, 03 Dec 2007)
> > New Revision: 16220
> >
> > Modified:
> > trunk/freenet/src/freenet/support/TimeUtil.java
> > Log:
> > TimeUtil: remove all the casting altogether
> >
> > Modified: trunk/freenet/src/freenet/support/TimeUtil.java
> > ===================================================================
> > --- trunk/freenet/src/freenet/support/TimeUtil.java 2007-12-03 13:08:51 UTC
> (rev 16219)
> > +++ trunk/freenet/src/freenet/support/TimeUtil.java 2007-12-03 14:19:43 UTC
> (rev 16220)
> > @@ -57,41 +57,41 @@
> > return sb.toString();
> > }
> > //
> > - long weeks = (l / ((long)7*24*60*60*1000));
> > + long weeks = (l / (1L*7*24*60*60*1000));
> > if (weeks > 0) {
> > sb.append(weeks).append('w');
> > termCount++;
> > - l = l - (weeks * ((long)7*24*60*60*1000));
> > + l = l - (weeks * (1L*7*24*60*60*1000));
> > }
> > if(termCount >= maxTerms) {
> > return sb.toString();
> > }
> > //
> > - long days = (l / ((long)24*60*60*1000));
> > + long days = (l / (1L*24*60*60*1000));
> > if (days > 0) {
> > sb.append(days).append('d');
> > termCount++;
> > - l = l - (days * ((long)24*60*60*1000));
> > + l = l - (days * (1L*24*60*60*1000));
> > }
> > if(termCount >= maxTerms) {
> > return sb.toString();
> > }
> > //
> > - long hours = (l / ((long)60*60*1000));
> > + long hours = (l / (1L*60*60*1000));
> > if (hours > 0) {
> > sb.append(hours).append('h');
> > termCount++;
> > - l = l - (hours * ((long)60*60*1000));
> > + l = l - (hours * (1L*60*60*1000));
> > }
> > if(termCount >= maxTerms) {
> > return sb.toString();
> > }
> > //
> > - long minutes = (l / ((long)60*1000));
> > + long minutes = (l / (1L*60*1000));
> > if (minutes > 0) {
> > sb.append(minutes).append('m');
> > termCount++;
> > - l = l - (minutes * ((long)60*1000));
> > + l = l - (minutes * (1L*60*1000));
> > }
> > if(termCount >= maxTerms) {
> > return sb.toString();
> > @@ -105,7 +105,7 @@
> > //l = l - ((long)fractionalSeconds * (long)1000);
> > }
> > } else {
> > - long seconds = (l / (long)1000);
> > + long seconds = (l / 1L*1000);
> > if (seconds > 0) {
> > sb.append(seconds).append('s');
> > termCount++;
> >
> > _______________________________________________
> > cvs mailing list
> > cvs at freenetproject.org
> > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> >
> >
> _______________________________________________
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL:
<https://emu.freenetproject.org/pipermail/devl/attachments/20071203/3be33f3c/attachment.pgp>