Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/Revlog.java @ 274:9fb50c04f03c
Use Nodeid.isNull check instead of NULL.equals
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Thu, 25 Aug 2011 03:57:39 +0200 |
| parents | 0e01f9182e16 |
| children | 74e7493a042a |
comparison
equal
deleted
inserted
replaced
| 273:8f872bd7ddd2 | 274:9fb50c04f03c |
|---|---|
| 14 * the terms of a license other than GNU General Public License | 14 * the terms of a license other than GNU General Public License |
| 15 * contact TMate Software at support@hg4j.com | 15 * contact TMate Software at support@hg4j.com |
| 16 */ | 16 */ |
| 17 package org.tmatesoft.hg.repo; | 17 package org.tmatesoft.hg.repo; |
| 18 | 18 |
| 19 import static org.tmatesoft.hg.core.Nodeid.NULL; | |
| 20 import static org.tmatesoft.hg.repo.HgRepository.BAD_REVISION; | 19 import static org.tmatesoft.hg.repo.HgRepository.BAD_REVISION; |
| 21 import static org.tmatesoft.hg.repo.HgRepository.TIP; | 20 import static org.tmatesoft.hg.repo.HgRepository.TIP; |
| 22 | 21 |
| 23 import java.io.IOException; | 22 import java.io.IOException; |
| 24 import java.nio.ByteBuffer; | 23 import java.nio.ByteBuffer; |
| 437 | 436 |
| 438 public Nodeid revision(int localRevision) { | 437 public Nodeid revision(int localRevision) { |
| 439 return sequential[localRevision]; | 438 return sequential[localRevision]; |
| 440 } | 439 } |
| 441 public int localRevision(Nodeid revision) { | 440 public int localRevision(Nodeid revision) { |
| 442 if (revision == null || NULL.equals(revision)) { | 441 if (revision == null || revision.isNull()) { |
| 443 return BAD_REVISION; | 442 return BAD_REVISION; |
| 444 } | 443 } |
| 445 int x = Arrays.binarySearch(sorted, revision); | 444 int x = Arrays.binarySearch(sorted, revision); |
| 446 if (x < 0) { | 445 if (x < 0) { |
| 447 return BAD_REVISION; | 446 return BAD_REVISION; |
