Re: [fpc-pascal] Booleans vs sets

2017-09-21 Thread Michael Van Canneyt



On Thu, 21 Sep 2017, Mattias Gaertner wrote:


On Thu, 21 Sep 2017 15:16:21 +0700
Ryan Joseph  wrote:


I have a class that is filling up with booleans. Would it be more efficient to 
store these as a “set of”? I have 10 bools which is getting up there.


Sets need less memory as they are stored as bits.
Speed depends on the operations and amount of objects.
I would recommend sets.


Same here.

Michael.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Booleans vs sets

2017-09-21 Thread Mattias Gaertner
On Thu, 21 Sep 2017 15:16:21 +0700
Ryan Joseph  wrote:

> I have a class that is filling up with booleans. Would it be more efficient 
> to store these as a “set of”? I have 10 bools which is getting up there.

Sets need less memory as they are stored as bits.
Speed depends on the operations and amount of objects.
I would recommend sets.

Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Booleans vs sets

2017-09-21 Thread Ryan Joseph
I have a class that is filling up with booleans. Would it be more efficient to 
store these as a “set of”? I have 10 bools which is getting up there.

Regards,
Ryan Joseph

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal