Performance improvement: remove table.clear call.

Because there is a index variable for the buffer table, each time when we want
to reset the buffer table, we just need to reset the index, no table.clear is
needed. And when we want to concat the table content into a string, set
concatenation range from 1 to index. After 1000 or 10000 times, we can discard
the table and create a new one to prevent memory leak.