Sha256: fc4e1c444bf3b314c6ec268dc26cf298d38f1a6e2d79ecc7bce7ac09e71d4448

Contents?: true

Size: 940 Bytes

Versions: 5

Compression:

Stored size: 940 Bytes

Contents

=begin
    Copyright 2010-2022 Ecsypno <http://www.ecsypno.com>

    This file is part of the Arachni Framework project and is subject to
    redistribution and commercial restrictions. Please see the Arachni Framework
    web site for more information on licensing and terms of use.
=end

require 'set'

module Arachni
module Support::LookUp

# Lightweight look-up Set implementation.
#
# It uses stores hashes of items instead of the items themselves.
#
# This leads to decreased memory consumption and faster comparisons during look-ups.
#
# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
class HashSet < Base

    # @param    (see Base#initialize)
    def initialize(*)
        super
        @collection = Set.new
    end

    [:merge, :replace, :superset?, :subset?].each do |m|
        define_method m do |other|
            @collection.send( m, other.collection )
            self
        end
    end
end

end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
arachni-1.6.1.3 lib/arachni/support/lookup/hash_set.rb
arachni-1.6.1.2 lib/arachni/support/lookup/hash_set.rb
arachni-1.6.1.1 lib/arachni/support/lookup/hash_set.rb
arachni-1.6.1 lib/arachni/support/lookup/hash_set.rb
arachni-1.6.0 lib/arachni/support/lookup/hash_set.rb