From 4b3950902bb23427ecb7186c630a077e0f853cdc Mon Sep 17 00:00:00 2001 From: Gulati <611186285@IUSER> Date: Tue, 13 Sep 2016 12:19:13 +0530 Subject: [PATCH] Changes to toStrig method in Coordinates Class . StringBuilder to be used in toString Method instead of StringBuffer as it is not shared in more than one threads. StringBuilder gives relatively high performance. --- src/com/thoughtworks/rover/universe/Coordinates.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/thoughtworks/rover/universe/Coordinates.java b/src/com/thoughtworks/rover/universe/Coordinates.java index 8df4de8..40170d9 100644 --- a/src/com/thoughtworks/rover/universe/Coordinates.java +++ b/src/com/thoughtworks/rover/universe/Coordinates.java @@ -16,7 +16,7 @@ public Coordinates newCoordinatesFor(final int xCoordinateStepValue, final int y @Override public String toString() { - StringBuffer coordinateOutput = new StringBuffer(); + StringBuilder coordinateOutput = new StringBuilder(); coordinateOutput.append(xCoordinate); coordinateOutput.append(" "); coordinateOutput.append(yCoordinate);