summaryrefslogtreecommitdiff
path: root/src/input.c
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-07-13 17:00:10 +0800
committerAdrian Thurston <thurston@colm.net>2018-07-13 17:00:10 +0800
commit24f1ce1025ab111c61ba7cd23120e0cbf9b92570 (patch)
tree6317b2de8135816864c053be68f2df958ab7caed /src/input.c
parent1c97b4e09f0b509ff69c8eb04339f754e73e02df (diff)
downloadcolm-24f1ce1025ab111c61ba7cd23120e0cbf9b92570.tar.gz
don't create an empty run buf every time we hit stream end
Diffstat (limited to 'src/input.c')
-rw-r--r--src/input.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/input.c b/src/input.c
index 9d93fb8e..99e65ec5 100644
--- a/src/input.c
+++ b/src/input.c
@@ -550,13 +550,10 @@ static tree_t *input_undo_prepend_stream( struct colm_program *prg, struct input
return 0;
}
-#define OPTIM_APPEND
-
static void input_append_data( struct colm_program *prg, struct input_impl_seq *si, const char *data, long length )
{
debug( prg, REALM_INPUT, "input_append_data: stream %p append data length %d\n", si, length );
-#ifdef OPTIM_APPEND
if ( si->queue.tail == 0 || si->queue.tail->type != SB_ACCUM ) {
debug( prg, REALM_INPUT, "input_append_data: creating accum\n" );
@@ -571,25 +568,12 @@ static void input_append_data( struct colm_program *prg, struct input_impl_seq *
}
si->queue.tail->si->funcs->append_data( prg, si->queue.tail->si, data, length );
-
-#else
-
- struct stream_impl *sub_si = colm_impl_new_text( "<text>", data, length );
-
- struct seq_buf *new_buf = new_seq_buf();
- new_buf->type = SB_ACCUM;
- new_buf->si = sub_si;
- new_buf->own_si = 1;
-
- input_stream_seq_append( si, new_buf );
-#endif
}
static tree_t *input_undo_append_data( struct colm_program *prg, struct input_impl_seq *si, int length )
{
debug( prg, REALM_INPUT, "input_undo_append_data: stream %p undo append data length %d\n", si, length );
-#ifdef OPTIM_APPEND
while ( true ) {
struct seq_buf *buf = si->queue.tail;
@@ -619,10 +603,6 @@ static tree_t *input_undo_append_data( struct colm_program *prg, struct input_im
struct seq_buf *seq_buf = input_stream_seq_pop_tail( si );
free( seq_buf );
}
-#else
- struct seq_buf *seq_buf = input_stream_seq_pop_tail( si );
- free( seq_buf );
-#endif
return 0;
}