[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-261-g47f2b
From: |
Mark H Weaver |
Subject: |
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-261-g47f2bce |
Date: |
Mon, 01 Apr 2013 01:14:41 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=47f2bce5ae332c274270882c259776b8e4ea12f7
The branch, stable-2.0 has been updated
via 47f2bce5ae332c274270882c259776b8e4ea12f7 (commit)
from b05257b9232e2ee631c28b15cace5981c4927446 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 47f2bce5ae332c274270882c259776b8e4ea12f7
Author: Mark H Weaver <address@hidden>
Date: Sun Mar 31 21:12:31 2013 -0400
Avoid unnecessary peeks for EOF in r6rs-ports.
* libguile/r6rs-ports.c (scm_get_bytevector_n, scm_get_bytevector_n_x,
scm_get_bytevector_some, scm_get_bytevector_all): Avoid peeking for
EOF when we already know.
-----------------------------------------------------------------------
Summary of changes:
libguile/r6rs-ports.c | 27 +++++++++------------------
1 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/libguile/r6rs-ports.c b/libguile/r6rs-ports.c
index d5fcd20..7ee7a69 100644
--- a/libguile/r6rs-ports.c
+++ b/libguile/r6rs-ports.c
@@ -496,16 +496,11 @@ SCM_DEFINE (scm_get_bytevector_n, "get-bytevector-n", 2,
0, 0,
/* Don't invoke `scm_c_read ()' since it may block. */
c_read = 0;
- if ((c_read == 0) && (c_count > 0))
+ if (c_read < c_count)
{
- if (scm_peek_byte_or_eof (port) == EOF)
- result = SCM_EOF_VAL;
+ if (c_read == 0)
+ result = SCM_EOF_VAL;
else
- result = scm_null_bytevector;
- }
- else
- {
- if (c_read < c_count)
result = scm_c_shrink_bytevector (result, c_read);
}
@@ -543,13 +538,8 @@ SCM_DEFINE (scm_get_bytevector_n_x, "get-bytevector-n!",
4, 0, 0,
/* Don't invoke `scm_c_read ()' since it may block. */
c_read = 0;
- if ((c_read == 0) && (c_count > 0))
- {
- if (scm_peek_byte_or_eof (port) == EOF)
- result = SCM_EOF_VAL;
- else
- result = SCM_I_MAKINUM (0);
- }
+ if (c_read == 0 && c_count > 0)
+ result = SCM_EOF_VAL;
else
result = scm_from_size_t (c_read);
@@ -599,11 +589,12 @@ SCM_DEFINE (scm_get_bytevector_some,
"get-bytevector-some", 1, 0, 0,
c_bv[c_total] = (char) c_chr;
c_total++;
}
+ else
+ break;
}
/* XXX: We want to check for the availability of a byte, but that's
what `scm_char_ready_p' actually does. */
- while (scm_is_true (scm_char_ready_p (port))
- && (scm_peek_byte_or_eof (port) != EOF));
+ while (scm_is_true (scm_char_ready_p (port)));
if (c_total == 0)
{
@@ -662,7 +653,7 @@ SCM_DEFINE (scm_get_bytevector_all, "get-bytevector-all",
1, 0, 0,
c_read = scm_c_read (port, c_bv + c_total, c_count);
c_total += c_read, c_count -= c_read;
}
- while (scm_peek_byte_or_eof (port) != EOF);
+ while (c_count == 0);
if (c_total == 0)
{
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-261-g47f2bce,
Mark H Weaver <=