Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/Internals.java @ 420:6c22bdc0bdfd
Respect long offsets in revlogs
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 22 Mar 2012 22:56:01 +0100 |
parents | 7f136a3fa671 |
children | fdd7d756dea0 |
comparison
equal
deleted
inserted
replaced
419:7f136a3fa671 | 420:6c22bdc0bdfd |
---|---|
392 v = String.valueOf(it.next()); | 392 v = String.valueOf(it.next()); |
393 sb.append(v); | 393 sb.append(v); |
394 } | 394 } |
395 return sb; | 395 return sb; |
396 } | 396 } |
397 | |
398 /** | |
399 * keep an eye on all long to int downcasts to get a chance notice the lost of data | |
400 * Use if there's even subtle chance there might be loss | |
401 * (ok not to use if there's no way for l to be greater than int) | |
402 */ | |
403 public static int ltoi(long l) { | |
404 int i = (int) l; | |
405 assert ((long) i) == l : "Loss of data!"; | |
406 return i; | |
407 } | |
397 } | 408 } |