[R-SIG-Mac] another (possible more controversial) patch to REditor.m

Byron Ellis bellis at hsph.harvard.edu
Thu Oct 21 10:35:07 CEST 2004


Before I head off to bed, I may as well post a patch for the real 
culprit of this evening's meanderings: the data editor. I had noticed 
(when the fan on my powerbook activated when it should have been 
sitting idle) that REditor pins the CPU while running. I tracked the 
problem down to

while(isDataEditor) [NSApp runModalForSession:session];

which pins out the CPU. Replacing this with [NSApp runModalForWindow:] 
seems to solve the problem (as it is more sophisticated than Apple's 
documentation suggests ) by not polling.

This patch also replaces the NSTableColumn identifier with an NSNumber 
rather than the NSString, eliminating the column lookup for loop. I had 
originally thought that code might be the culprit (it turns out not to 
be a problem).

Right, I'm for bed now...The Red Sox have won and I think the caffeine 
is finally wearing off. :-) (No, I'm not on the East Coast of the US 
ATM. Its really only about 1:30am, which isn't really all that late)



-------------- next part --------------
A non-text attachment was scrubbed...
Name: editor.diff
Type: application/octet-stream
Size: 2150 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20041021/e7d158be/editor.obj
-------------- next part --------------

---
Byron Ellis (bellis at hsph.harvard.edu)
"Oook" -- The Librarian


More information about the R-SIG-Mac mailing list