| 7875 | } |
| 7876 | |
| 7877 | void append(const xpath_node* begin_, const xpath_node* end_, xpath_allocator* alloc) |
| 7878 | { |
| 7879 | if (begin_ == end_) return; |
| 7880 | |
| 7881 | size_t size_ = static_cast<size_t>(_end - _begin); |
| 7882 | size_t capacity = static_cast<size_t>(_eos - _begin); |
| 7883 | size_t count = static_cast<size_t>(end_ - begin_); |
| 7884 | |
| 7885 | if (size_ + count > capacity) |
| 7886 | { |
| 7887 | // reallocate the old array or allocate a new one |
| 7888 | xpath_node* data = static_cast<xpath_node*>(alloc->reallocate(_begin, capacity * sizeof(xpath_node), (size_ + count) * sizeof(xpath_node))); |
| 7889 | assert(data); |
| 7890 | |
| 7891 | // finalize |
| 7892 | _begin = data; |
| 7893 | _end = data + size_; |
| 7894 | _eos = data + size_ + count; |
| 7895 | } |
| 7896 | |
| 7897 | memcpy(_end, begin_, count * sizeof(xpath_node)); |
| 7898 | _end += count; |
| 7899 | } |
| 7900 | |
| 7901 | void sort_do() |
| 7902 | { |
no test coverage detected