On Sat, 20 Jun 2009 08:47:23 +0400 Sergey Semernin <[email protected]> said:
> Hello, All. > > In message from 20 june 2009 Gustavo Sverzut Barbieri wrote: > > > > to be realistic - this will never make a difference. you many gadgets do > > > you expect to have in a list? 100? 1000? more? you know that if 1 module > > > provides 1 gadget... you'll run out of fd's long before you have enough > > > items for this to matter. this is micro-optimisation with no real effect. > > > :( every list item created will probably do dozens and dozens of > > > strcmp's. this won't make a dent at all. even if they were all removed > > > you'd still barely notice. :) > > > > But why do a not so good solution when the other solution is actually > > simpler code-wise? You'd be changing handling of pointers (!NULL) and > > then a comparison by just comparing two values. > > > > Actually, after discussing this Sergey just wisely remembered that we > > should use simple ENUM/integers and that gets even more simpler. Given > > the number of things this could grow, I would even say that integers > > should be powers of 2 and use a mask of accepted types, then no need > > to do functions and all, just set your mask and be happy. > > So, what solution we will come? Should I make it with integer enums? > And inside is_site callback we can use masks, cases, and etc., what we need > in concrete module. a bitmask is almost reasonable... as that limits us to 32 gadget locations (lets be real. we'll use an int). right now it seems ok, but... in the long run, i am not so sure. an enum and just check if the is_site returns true when passed the target location seems expandable enough for me. :) (that'll give us 4 billion or so locations... i'm happy with that) -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) [email protected] ------------------------------------------------------------------------------ Are you an open source citizen? Join us for the Open Source Bridge conference! Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250. Need another reason to go? 24-hour hacker lounge. Register today! http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
