Cleanup is used to avoid holding on to memory unnecessarily (for the cases where we reuse a Scanner).
()
| 103 | // Cleanup is used to avoid holding on to memory unnecessarily (for the cases |
| 104 | // where we reuse a Scanner). |
| 105 | func (s *Scanner) Cleanup() { |
| 106 | s.bytesPrealloc = nil |
| 107 | s.Comments = nil |
| 108 | s.retainComments = false |
| 109 | } |
| 110 | |
| 111 | func (s *Scanner) allocBytes(length int) []byte { |
| 112 | if cap(s.bytesPrealloc) >= length { |
no outgoing calls
no test coverage detected