diff options
Diffstat (limited to 'include/ocl')
| -rw-r--r-- | include/ocl/tproc/detail/rope_fwd.inl | 13 | ||||
| -rw-r--r-- | include/ocl/tproc/rope.hpp | 2 | ||||
| -rw-r--r-- | include/ocl/tproc/rope.inl | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/include/ocl/tproc/detail/rope_fwd.inl b/include/ocl/tproc/detail/rope_fwd.inl index fffbce3..1ef44bf 100644 --- a/include/ocl/tproc/detail/rope_fwd.inl +++ b/include/ocl/tproc/detail/rope_fwd.inl @@ -21,22 +21,22 @@ namespace ocl::tproc using error_type = boost::system::error_code; using allocator_type = Allocator; + // B-Tree fields. rope_ptr left_{nullptr}; // Left child (internal node only) rope_ptr right_{nullptr}; // Right child (internal node only) size_type weight_{0}; // Size of left subtree (internal) OR data size (leaf) value_type* blob_{nullptr}; // Character data (leaf node only) size_type capacity_{0}; // Allocated blob capacity allocator_type alloc_; - error_type ec_{}; - bool is_leaf() const + public: + tree_impl(Allocator alloc = Allocator()) : alloc_(alloc) { - return blob_ != nullptr; } - public: - tree_impl(Allocator alloc = Allocator()) : alloc_(alloc) + bool is_leaf() const { + return blob_ != nullptr; } tree_impl(const boost::core::basic_string_view<CharT>& str, Allocator alloc = Allocator()) : weight_(str.size()), alloc_(alloc), capacity_(str.size()) @@ -136,6 +136,7 @@ namespace ocl::tproc // Split leaf node if (pos == 0) return {nullptr, this_rope}; + if (pos >= weight_) return {this_rope, nullptr}; @@ -467,6 +468,7 @@ namespace ocl::tproc return false; size_type offset = this_size - other_size; + for (size_type i = 0; i < other_size; ++i) { if (impl_->at(offset + i) != other.impl_->at(i)) @@ -552,6 +554,7 @@ namespace ocl::tproc { return impl_->insert(pos, text, l); } + } // namespace ocl::tproc #endif diff --git a/include/ocl/tproc/rope.hpp b/include/ocl/tproc/rope.hpp index 21277f2..f36eb18 100644 --- a/include/ocl/tproc/rope.hpp +++ b/include/ocl/tproc/rope.hpp @@ -103,7 +103,7 @@ namespace ocl::tproc::rope { std::transform(cond_.begin(), cond_.end(), - [](std::allocator_traits<ocl::tproc::crope>::value_type& ch) { + [](std::allocator_traits<It>::value_type& ch) { return std::tolower(ch); }); diff --git a/include/ocl/tproc/rope.inl b/include/ocl/tproc/rope.inl index 2c421d2..2545e3e 100644 --- a/include/ocl/tproc/rope.inl +++ b/include/ocl/tproc/rope.inl @@ -40,7 +40,6 @@ namespace ocl::tproc::rope template <typename It, class Pred> typename Pred::size_type erase(It begin, It end, Pred pred) { - It original_begin = begin; typename Pred::size_type count{}; for (auto it = begin; it != end;) @@ -62,7 +61,6 @@ namespace ocl::tproc::rope template <typename It, class Pred> typename It::size_type erase_if(It begin, It end, Pred) { - It original_begin = begin; typename Pred::size_type count{}; for (auto it = begin; it != end;) |
