From aab1caadd3cc6453b93448f8910c65c3ddc1fcb1 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Fri, 4 Apr 2003 21:50:15 +0000 Subject: [PATCH] * ports.c (scm_getc): minor tweak. --- libguile/ports.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/libguile/ports.c b/libguile/ports.c index 52315df09..bad95a7c6 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -924,10 +924,8 @@ scm_getc (SCM port) scm_t_port *pt = SCM_PTAB_ENTRY (port); if (pt->rw_active == SCM_PORT_WRITE) - { - /* may be marginally faster than calling scm_flush. */ - scm_ptobs[SCM_PTOBNUM (port)].flush (port); - } + /* may be marginally faster than calling scm_flush. */ + scm_ptobs[SCM_PTOBNUM (port)].flush (port); if (pt->rw_random) pt->rw_active = SCM_PORT_READ; @@ -940,19 +938,19 @@ scm_getc (SCM port) c = *(pt->read_pos++); - if (c == '\n') + switch (c) { - SCM_INCLINE (port); + case '\n': + SCM_INCLINE (port); + break; + case '\t': + SCM_TABCOL (port); + break; + default: + SCM_INCCOL (port); + break; } - else if (c == '\t') - { - SCM_TABCOL (port); - } - else - { - SCM_INCCOL (port); - } - + return c; }