[ruby-core:94813] [Ruby master Bug#16026] `Set#count` performance issues

From: samuel@...
Date: 2019-09-06 23:06:56 UTC
List: ruby-core #94813
Issue #16026 has been updated by ioquatix (Samuel Williams).

Status changed from Open to Rejected

Given the discussion, I'm okay if we just reject this feature. @knu it's up to you if you want to implement it or not. Even thought it can make sense from one POV, the correct solution for most users is just to use `#size` when it's available, rather than making `#count` more complicated implementation (and potentially slower).

Ultimately, it was my fault for not understanding `#count`.

----------------------------------------
Bug #16026: `Set#count` performance issues
https://bugs.ruby-lang.org/issues/16026#change-81434

* Author: ioquatix (Samuel Williams)
* Status: Rejected
* Priority: Normal
* Assignee: knu (Akinori MUSHA)
* Target version: 
* ruby -v: 
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
`Set#size` is O(1), but `Set#count` is O(N).

I would like to add `alias count size` to `class Set`

Is it okay?



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next