mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
bug 57840: lazily compute hashCode; patch from Greg Woolsey
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1747881 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
460540ded2
commit
370a0563e8
@ -62,16 +62,18 @@ final class XSSFEvaluationSheet implements EvaluationSheet {
|
||||
private static class CellKey {
|
||||
private final int _row;
|
||||
private final int _col;
|
||||
private final int _hash;
|
||||
private int _hash = -1; //lazily computed
|
||||
|
||||
protected CellKey(int row, int col) {
|
||||
_row = row;
|
||||
_col = col;
|
||||
_hash = (17 * 37 + row) * 37 + col;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
if ( _hash == -1 ) {
|
||||
_hash = (17 * 37 + _row) * 37 + _col;
|
||||
}
|
||||
return _hash;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user