From d45f5ab8c821c602affb38fc8bc4c811d6900be1 Mon Sep 17 00:00:00 2001 From: dchandler Date: Tue, 3 Jun 2003 23:49:34 +0000 Subject: [PATCH] Improved performance (I suppose). --- source/org/thdl/tib/text/DuffData.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/org/thdl/tib/text/DuffData.java b/source/org/thdl/tib/text/DuffData.java index 11c5168..7b4258a 100644 --- a/source/org/thdl/tib/text/DuffData.java +++ b/source/org/thdl/tib/text/DuffData.java @@ -68,12 +68,16 @@ public class DuffData { you call setData or manipulate the public fields. */ public DuffData() { } + /** here for efficiency */ + private static char[] chars = new char[1]; + /** Changes the text and font this DuffData represents. * @param c a character of TibetanMachineWeb or TibetanMachine text * @param i a TibetanMachineWeb or TibetanMachine font number */ public void setData(char c, int i) { - text = new String(new char[] { c }); + chars[0] = c; + text = new String(chars); font = i; } }