Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ender land

macrumors 6502a
Original poster
Oct 26, 2010
876
0
Whenever I paste or delete the following excerpt within xcode, it gets unbelievably slow (probably 30 second time from "cmd v" to actually showing the text)


Code:
				//add all times to that value
				for (multimap<PathID, double>::iterator i = pathTimes.first; i != pathTimes.second; i++) {

					if (temp == 0) {
						firstPathID = (*i).first;
						firstPathIDtime = (*i).second;
					}
					
					if (temp == 1) {
						
						secondPathID = (*i).first;
						secondPathIDtime = (*i).second;
					}
					temp++;
				}

Is there something within that causing the problem?
 

chown33

Moderator
Staff member
Aug 9, 2009
10,751
8,425
A sea of green
A. Which version of Xcode?

B. What kind of file are you pasting into? .cpp, .mm, something else?

C. If you disable syntax coloring, does the problem disappear?
 

PatrickCocoa

macrumors 6502a
Dec 2, 2008
751
149
Just for fun

Just for fun I copied your code and pasted it into a project I had open. Xcode 4.0.2 Build 4A2002a, iMac 3.06 GHz core 2 duo, 2 TB hard drive with probably > 1TB free, syntax coloring on, pasting to the bottom of a .m file (before the @end).

No problems. Pasted in less than a second, same for cut.
 

jiminaus

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
If this is an issue with the syntax highlighter, then it wouldn't be this code per se, but the context in which the code is being inserted. I notice that it's really deeply indented (or at least for my style it is).
 

ender land

macrumors 6502a
Original poster
Oct 26, 2010
876
0
A. Which version of Xcode?

B. What kind of file are you pasting into? .cpp, .mm, something else?

C. If you disable syntax coloring, does the problem disappear?


A) 3.2 (or whatever the latest on 3 is)
B) it is a relatively lengthy .cpp file
c) I am not sure, I will check that


How much free space available on the boot drive, and what size drvie, before the paste operation?

Some 40GB worth of space (getting to the point I need a new drive!)


If this is an issue with the syntax highlighter, then it wouldn't be this code per se, but the context in which the code is being inserted. I notice that it's really deeply indented (or at least for my style it is).
Yeah it is fairly nested unfortunately as a result of a lot of logic :(

It is possible that the use of "i" as an iterator was causing problems as this was nested in another larger loop using the variable "i" in an alternate iterator.

Maybe xcode just goes insane trying to track the variables if you do this? STill seems weird to lag that badly.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.