Reduced multiple instantiation of temporary object. Better update it.
@@ -210,13 +210,14 @@ private void fillBlock(Block X, Block Y, Block currentBlock, boolean withXor)
private void fillMemoryBlocks()
{
+ Position position = new Position();
for (int i = 0; i < parameters.getIterations(); i++)
{
for (int j = 0; j < ARGON2_SYNC_POINTS; j++)
{
for (int k = 0; k < parameters.getLanes(); k++)
{
- Position position = new Position(i, k, j, 0);
+ position.update(i, k, j, 0);
fillSegment(position);
}
}
@@ -711,8 +712,12 @@ public void clear()
int slice;
int index;
- Position(int pass, int lane, int slice, int index)
+ Position()
{
+
+ }
+
+ void update(int pass, int lane, int slice, int index) {
this.pass = pass;
this.lane = lane;
this.slice = slice;
