summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorZsolt Kozaroczy <[email protected]>2023-05-31 09:06:35 +0200
committerGitHub <[email protected]>2023-05-31 09:06:35 +0200
commitc1061e34e294f87030128abf1730fcf4a5ecb406 (patch)
treec0c75f41ec59362bcc40edbfe238c2f8878cb93c /lib
parentf7a8edbefb4311d24f37b9372982a03d823654fd (diff)
parent5dea3e7092fb3a4667cbb50a9885d0ec4aed77b7 (diff)
downloadcaxlsx-c1061e34e294f87030128abf1730fcf4a5ecb406.tar.gz
caxlsx-c1061e34e294f87030128abf1730fcf4a5ecb406.zip
Merge pull request #255 from pkmiec/fixSimpleTypeListRegression
Use #== and #eql? from BasicObject
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/util/simple_typed_list.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/axlsx/util/simple_typed_list.rb b/lib/axlsx/util/simple_typed_list.rb
index c3910fca..e74e25e3 100644
--- a/lib/axlsx/util/simple_typed_list.rb
+++ b/lib/axlsx/util/simple_typed_list.rb
@@ -15,6 +15,12 @@ module Axlsx
undef_method name
end
+ # We often call index(element) on instances of SimpleTypedList. Thus, we do not want to inherit Array
+ # implementation of == / eql? which walks the elements calling == / eql?. Instead we want the fast
+ # and original versions from BasicObject.
+ alias :== :equal?
+ alias :eql? :equal?
+
# Creats a new typed list
# @param [Array, Class] type An array of Class objects or a single Class object
# @param [String] serialize_as The tag name to use in serialization