| 8929 | } |
| 8930 | |
| 8931 | void append(const xpath_node* begin_, const xpath_node* end_, xpath_allocator* alloc) |
| 8932 | { |
| 8933 | if (begin_ == end_) return; |
| 8934 | |
| 8935 | size_t size_ = static_cast<size_t>(_end - _begin); |
| 8936 | size_t capacity = static_cast<size_t>(_eos - _begin); |
| 8937 | size_t count = static_cast<size_t>(end_ - begin_); |
| 8938 | |
| 8939 | if (size_ + count > capacity) |
| 8940 | { |
| 8941 | // reallocate the old array or allocate a new one |
| 8942 | xpath_node* data = static_cast<xpath_node*>(alloc->reallocate(_begin, capacity * sizeof(xpath_node), (size_ + count) * sizeof(xpath_node))); |
| 8943 | if (!data) return; |
| 8944 | |
| 8945 | // finalize |
| 8946 | _begin = data; |
| 8947 | _end = data + size_; |
| 8948 | _eos = data + size_ + count; |
| 8949 | } |
| 8950 | |
| 8951 | memcpy(_end, begin_, count * sizeof(xpath_node)); |
| 8952 | _end += count; |
| 8953 | } |
| 8954 | |
| 8955 | void sort_do() |
| 8956 | { |
no test coverage detected