3 ms·
The fact that 30 is suspiciously close to 32 makes the impression that there's some unholy C black magic in the background of the bug. I wish programmers stoppe
by DrJokepu 17y ago
The fact that 30 is suspiciously close to 32 makes the impression that there's some unholy C black magic in the background of the bug. I wish programmers stopped doing stuff like that unless they really have to.
- pwmanagerdied 17y agoHuh. A five bit range would give a max of 31, and if we assume that the default/built-in stylesheet knocks another off, that's 30. I agree with you, though I think I'd prefer this to hint at the reason over it being an entirely arbitrary descision. Making such a choice for a bad reason is still preferable to making it for no reason.
- kingkilr 17y agoYeah, I'm hoping it's that. Purely arbitrary would just be... stupid.
- Periodic 17y agostruct Element { // Update: apparently 16 wasn't enough. Raised to 30 to pass test #452 StyleData styles[30]; // No one uses more than 16 style parameters anyway. }
- wheels 17y agoIt may be a sanity check; often when writing parsers for "in the wild" data you have to pick a cutoff for where "doesn't make sense" is so that you can tell if you're looking at junk data and stop trying to make sense of it (and the RAM / CPU entailed in such).
- Empact 17y agoThis is what happens when you work at a company which doesn't have the sense and engineering leadership to arrive at a single core set of collections and such ala CoreFoundation: http://developer.apple.com/mac/library/documentation/CoreFoundation/Reference/CoreFoundation_Collection/index.html http://developer.apple.com/mac/library/documentation/CoreFou... Microsoft has a hodge podge of several attempts at the same, and because none is truly core and universally available, it's quite easy to be ignorant of what's available and roll your own crappy, limited data structures.