mirror of https://github.com/apache/poi.git
[github-408] Increase performance of StylesTable.putStyle. Thanks to Jason Mirra. This closes #408
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1906152 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f78d742c38
commit
7807b706ac
|
@ -467,10 +467,12 @@ public class StylesTable extends POIXMLDocumentPart implements Styles {
|
||||||
public int putStyle(XSSFCellStyle style) {
|
public int putStyle(XSSFCellStyle style) {
|
||||||
CTXf mainXF = style.getCoreXf();
|
CTXf mainXF = style.getCoreXf();
|
||||||
|
|
||||||
if(! xfs.contains(mainXF)) {
|
int ret = xfs.indexOf(mainXF);
|
||||||
|
if(ret == -1) {
|
||||||
xfs.add(mainXF);
|
xfs.add(mainXF);
|
||||||
|
ret = xfs.size() - 1;
|
||||||
}
|
}
|
||||||
return xfs.indexOf(mainXF);
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue