[email protected] writes: > By the way, this is extremely inefficient. We have e.g. this code in > Buffer.cpp: > string target = func.getArg(0); > string target_name = func.getArg(1); > string command = func.getArg(2); > As a result, we parse the argument string three times! It seems to me > that we should either (a) expose a "getArgs" routine that returns a > vector<string> and let the caller extract them by position: > vector<string> args = func.getArgs(); > string target = args[0]; > etc; > or (b) cache the vector<string> in the FuncRequest object itself. The > latter wouldn't in fact require much memory, because these objects are > generally short-lived. > > Opinions?
I agree that it is inefficient, but I do not believe that we suffer from it in real life. But indeed, the code hurts the eyes. JMarc
