Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitece84bf

Browse files
author
Barry Lind
committed
Applied patch from Fernando Nasser to improve buffer sizes to avoid unnecessary resizing.
1 parentfb630cc commitece84bf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
importjava.sql.Types;
2626
importjava.util.Vector;
2727

28-
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.22 2003/05/29 04:39:49 barry Exp $
28+
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.23 2003/05/29 04:48:33 barry Exp $
2929
* This class defines methods of the jdbc1 specification. This class is
3030
* extended by org.postgresql.jdbc2.AbstractJdbc2Statement which adds the jdbc2
3131
* methods. The real Statement class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Statement
@@ -1032,7 +1032,7 @@ public void setString(int parameterIndex, String x, String type) throws SQLExcep
10321032
synchronized (sbuf)
10331033
{
10341034
sbuf.setLength(0);
1035-
sbuf.ensureCapacity(x.length());
1035+
sbuf.ensureCapacity(x.length() + (int)(x.length() /10));
10361036
inti;
10371037

10381038
sbuf.append('\'');

‎src/interfaces/jdbc/org/postgresql/util/PGbytea.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 2003, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/util/Attic/PGbytea.java,v 1.7 2003/03/07 18:39:46 barry Exp $
9+
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/util/Attic/PGbytea.java,v 1.8 2003/05/29 04:48:33 barry Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -68,7 +68,7 @@ public static String toPGString(byte[] p_buf) throws SQLException
6868
{
6969
if (p_buf ==null)
7070
returnnull;
71-
StringBufferl_strbuf =newStringBuffer(p_buf.length);
71+
StringBufferl_strbuf =newStringBuffer(2 *p_buf.length);
7272
for (inti =0;i <p_buf.length;i++)
7373
{
7474
intl_int = (int)p_buf[i];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp