Simplify is_empty() check

pull/3/head
sgoudham 3 years ago
parent d64e073aaf
commit 68a011800a
Signed by: hammy
GPG Key ID: 44E818FD5457EEA4

@ -274,7 +274,7 @@ impl<T: Ord> BinarySearchTree<T> {
} }
pub fn is_empty(&self) -> bool { pub fn is_empty(&self) -> bool {
self.root.is_none() self.size == 0
} }
pub fn insert(&mut self, value: T) { pub fn insert(&mut self, value: T) {

Loading…
Cancel
Save