UString methods
UString methods
I don't know how widespread UStirng is in UOX. But one thing it does is pass its parameters on most of its methods by value. This is clearly not the most effeicent for 90% of its calls. One may want to consider optimzing it a tad, if in widespread use by adding a reference (&) to the calls. However, ensure it doesn't modify the variable in the method.
-
Maarc
- Developer
- Posts: 576
- Joined: Sat Mar 27, 2004 6:22 am
- Location: Fleet, UK
- Has thanked: 0
- Been thanked: 0
- Contact:
While it may not be the most efficient way, it certainly isn't too bad. I ran a quick and dirty comparison a while back, and at least under release, it's only marginally slower to startup, where most of the UString stuff would occur (and it really was marginal). Under debug, it's slower definitely, but VC seems to manage (at least at 7.1) to get a lot of speed out of it.
There are 562 references to UString in the source code. Some will be in its implementation, others in comment lines, but it is quite widespread now. More references to UString than char *, by 2:1.
There are 562 references to UString in the source code. Some will be in its implementation, others in comment lines, but it is quite widespread now. More references to UString than char *, by 2:1.