|
|
|
|
|
by asveikau
4249 days ago
|
|
Possibly safe but definitely inefficient, since it has to find the end of the string to know where the destination pointer starts. The right way is to keep a pointer to the end. (Or since they are already using std::string in other places, maybe just do that everywhere, I'm sure it makes better choices than they did here.) The pointer cast thing is glaring. Why not simply declare the buffer as a char array and be done with it, instead of casting at every use? IMO over-use of pointer casts is a clear sign someone is lost in the language, your goal should be to reduce them. |
|