Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielKrawisz committed Mar 15, 2024
1 parent af02824 commit f3439d4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def set_version (self):
if "CURRENT_VERSION" in environ:
self.version = environ['CURRENT_VERSION']
else:
self.version = "v0.0.26"
self.version = "v0.0.27"

def configure_cmake (self):
cmake = CMake (self)
Expand Down
9 changes: 6 additions & 3 deletions include/data/tools/ordered_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace data::tool {
}

template <data::sequence X> requires std::equality_comparable_with<element, data::element_of<X>>
bool operator == (const X& x) const {
bool operator == (const X &x) const {
return sequence_equal (*this, x);
}

Expand Down Expand Up @@ -92,8 +92,11 @@ namespace data::tool {

template <functional::stack stack, ordered element>
ordered_stack<stack, element> ordered_stack<stack, element>::insert (const element &x) const {
if (this->empty () || x < this->first ()) return {this->prepend (x)};
return {rest ().insert (x).prepend (this->first ())};
if (this->empty () || x < this->first ()) {
return ordered_stack {this->prepend (x)};
}

return ordered_stack {rest ().insert (x).prepend (this->first ())};
}
}

Expand Down
1 change: 1 addition & 0 deletions include/data/tools/rb_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ namespace data::tool {
};

// a map that is good for deriving from.
// NOTE: it seems that using this type leads to segmentation faults, not sure why.
template <typename K, typename V, typename derived> struct base_rb_map : rb_map<K, V> {
using rb_map<K, V>::rb_map;

Expand Down
7 changes: 4 additions & 3 deletions include/milewski/RBMap/RBMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ namespace milewski::okasaki {

RBMap inserted (const K &x, const V &v) const
{
RBMap t = ins(x, v);
return RBMap(B, t.left(), t.rootKey (), t.rootValue (), t.right ());
RBMap t = ins (x, v);
return RBMap (B, t.left (), t.rootKey (), t.rootValue (), t.right ());
}

template<class F>
Expand Down Expand Up @@ -153,7 +153,8 @@ namespace milewski::okasaki {

RBMap ins (const K &x, const V &v) const
{
assert1();

assert1 ();
if (isEmpty ())
return RBMap (R, RBMap (), x, v, RBMap ());
K y = rootKey ();
Expand Down

0 comments on commit f3439d4

Please sign in to comment.