Skip to content

Conversation

@segeljakt
Copy link
Contributor

@segeljakt segeljakt commented Jul 18, 2020

This PR contains a couple of minor improvements. The most important change is in Reactive. I found a bug in my implementation which only happens when FlatFat contains only one element which is both a leaf and a root node. When updating a leaf node, I need to access its parent. The program crashed because the root node has no parent. Reactive now ensures that a leaf cannot be a root by never resizing if there is only one element in the window. This is the part of the Reactive algorithm I'm referring to. The bug happened when leaf(loci) = T.root.

image

I realised I also somehow forgot to make the Reactive-FlatFat buffer circular 👀 It should be fixed now.

The PR in addition adds some small extension methods to FifoWindows:

  • Added len method for calculating the number of elements in a window.
  • Added is_empty method for calculating if a window is empty.

@segeljakt segeljakt changed the title Minor refactors, bugfix and test additions Minor refactors, bugfix, features and test additions Jul 18, 2020
@scotts scotts merged commit c1748cd into IBM:master Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants