From ece84bf8194566ba02b51299aa7ab256af2ec8c1 Mon Sep 17 00:00:00 2001 From: Barry Lind Date: Thu, 29 May 2003 04:48:33 +0000 Subject: [PATCH] Applied patch from Fernando Nasser to improve buffer sizes to avoid unnecessary resizing. --- .../jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java | 4 ++-- src/interfaces/jdbc/org/postgresql/util/PGbytea.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java index 456697cd36..a1c9007fb2 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java @@ -25,7 +25,7 @@ import java.sql.Timestamp; import java.sql.Types; import java.util.Vector; -/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.22 2003/05/29 04:39:49 barry Exp $ +/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.23 2003/05/29 04:48:33 barry Exp $ * This class defines methods of the jdbc1 specification. This class is * extended by org.postgresql.jdbc2.AbstractJdbc2Statement which adds the jdbc2 * methods. The real Statement class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Statement @@ -1032,7 +1032,7 @@ public abstract class AbstractJdbc1Statement implements BaseStatement synchronized (sbuf) { sbuf.setLength(0); - sbuf.ensureCapacity(x.length()); + sbuf.ensureCapacity(x.length() + (int)(x.length() / 10)); int i; sbuf.append('\''); diff --git a/src/interfaces/jdbc/org/postgresql/util/PGbytea.java b/src/interfaces/jdbc/org/postgresql/util/PGbytea.java index d754cbfd68..31eb0c4d94 100644 --- a/src/interfaces/jdbc/org/postgresql/util/PGbytea.java +++ b/src/interfaces/jdbc/org/postgresql/util/PGbytea.java @@ -6,7 +6,7 @@ * Copyright (c) 2003, PostgreSQL Global Development Group * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/util/Attic/PGbytea.java,v 1.7 2003/03/07 18:39:46 barry Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/util/Attic/PGbytea.java,v 1.8 2003/05/29 04:48:33 barry Exp $ * *------------------------------------------------------------------------- */ @@ -68,7 +68,7 @@ public class PGbytea { if (p_buf == null) return null; - StringBuffer l_strbuf = new StringBuffer(p_buf.length); + StringBuffer l_strbuf = new StringBuffer(2 * p_buf.length); for (int i = 0; i < p_buf.length; i++) { int l_int = (int)p_buf[i]; -- 2.40.0