Home » U++ Library support » U++ Core » Small optimization
Small optimization [message #57056] |
Tue, 18 May 2021 15:36  |
Didier
Messages: 726 Registered: November 2008 Location: France
|
Contributor |
|
|
Hello Mirek,
I have a small optimisation proposition for cases where fundamental data types are used
in Vcont.h
Replace:
template <class T>
inline void Construct(T *t, const T *lim) {
while(t < lim)
new(t++) T;
}
with:
template <class T>
inline void Construct(T *t, const T *lim) {
if ( ! std::is_fundamental<T>::value ) {
while(t < lim)
new(t++) T;
}
}
Other methods near this one can benefit from this small optimisation (Destroy for example)
Note: Tested on my app : everything seems to work fine
[Updated on: Tue, 18 May 2021 16:58] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Sat May 10 00:44:09 CEST 2025
Total time taken to generate the page: 0.03554 seconds
|