Micro-optimize Repository to use switch statements
commitdfed42e7128b3d531fd1d9f7a58b86a293d8175f
authorYann Simon <yann.simon.fr@gmail.com>
Sun, 1 Feb 2009 16:30:19 +0000 (1 17:30 +0100)
committerShawn O. Pearce <spearce@spearce.org>
Sun, 1 Feb 2009 18:07:24 +0000 (1 10:07 -0800)
tree0a0ef929b83664189266e3b7f27ac6b1a8f88f06
parent9f6b735f22d5270714fbceeaf91f04ef63f68d95
Micro-optimize Repository to use switch statements

Instead of using multiple ifs that will evaluate an expression once
per conditional, use a switch with cases to evaluate the expression
only once.

This is much more typical usage of the getType() result from an
ObjectLoader; almost every other call location uses a switch to
handle the 4 possible return values.

Signed-off-by: Yann Simon <yann.simon.fr@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java