# Observable on Set?

**URL:** <https://www.ruby-forum.com/t/observable-on-set/169928>\
**Category:** Ruby\
**Created:** [June 10, 2009, 11:29am UTC](https://www.ruby-forum.com/t/observable-on-set/169928 "2009-06-10T11:29:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![james-calivar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@james-calivar](https://www.ruby-forum.com/u/james-calivar)\
**Post date:** [June 10, 2009, 11:29am UTC](https://www.ruby-forum.com/t/observable-on-set/169928/1 "2009-06-10T11:29:43Z")

</div>

Quick question, is there a reason why Observable uses an Array for  
storage  
instead of a Set? Wouldn’t a Set be faster, especially for removing  
observers? Are there other places in the standard library where use of  
data  
structures could be improved?

---

<div class="post-metadata">

**Author:** ![james-calivar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@james-calivar](https://www.ruby-forum.com/u/james-calivar)\
**Post date:** [June 10, 2009, 11:47am UTC](https://www.ruby-forum.com/t/observable-on-set/169928/2 "2009-06-10T11:47:51Z")

</div>

2009/6/10 James C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> Quick question, is there a reason why Observable uses an Array for storage  
> instead of a Set? Wouldn’t a Set be faster, especially for removing  
> observers? Are there other places in the standard library where use of data  
> structures could be improved?

Gah, I was looking at the 1.8 lib. 1.9 uses a Hash. Sorry!
