Cached the result of 'glm::vec3(size * 0.63f)' in a temporary variable to avoid multiple identical function calls and improve performance.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
The 'empty()' method is more efficient for checking if a string is empty compared to comparing it with an empty string literal.
The default constructor 'std::wstring()' is more efficient for creating an empty string compared to using a string literal.
The 'clear()' method is more efficient for clearing a std::wstring compared to assigning it an empty string literal.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Replaced copying of the 'sources' variable with move semantics to improve performance.
By moving instead of copying, we avoid unnecessary copying of data and enhance efficiency.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Creating variables in a more localized scope can enhance performance and make the code easier to understand.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Replaced 'std::optional::value()' with '*' operator to improve performance.
Using 'std::optional::value()' involves additional overhead compared to using the '*' or '->' operators. This change ensures more efficient access to the underlying value of the optional when you are certain that it contains a value.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Replaced 'at()' method with 'operator[]' to improve performance.
The 'at()' method performs bounds checking, which can introduce overhead. Using 'operator[]' bypasses this check and can improve performance when you are certain that the index is within bounds.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Passing cheap-to-copy arguments by reference can sometimes lead to decreased performance. This change ensures that the argument is passed by value, which is more efficient in cases where the argument is inexpensive to copy.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Replaced 'emplace' with 'try_emplace' to avoid unnecessary copies or moves when insertion fails.
The 'emplace' function does not guarantee that arguments will not be copied or moved if insertion is not successful. Using 'try_emplace' ensures that arguments are only copied or moved if the insertion actually takes place, thus improving performance.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
The 'current.reset(lang.release())' expression is equivalent to 'current = std::move(lang)'.
Changed 'current.reset(lang.release())' to 'current = std::move(lang)' to improve code clarity and performance.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
It's better to use '= default;' syntax instead of empty constructor and destructor body.
Using '= default;' can help the compiler generate more optimal code.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Created references to avoid using repeated expressions, improving performance across multiple instances.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Rearranged structure fields in decreasing order of size to reduce structure size from 32 to 24 and 12 to 8 bytes on 64-bit platforms.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Block selection clears before new selection be drawn
Added a call to LineBatch::flush() to ensure that all buffered data is correctly uploaded to the GPU and rendered. The missing flush() was causing rendering artifacts, such as flickering of block outlines, which has now been resolved by ensuring that all accumulated data is processed and rendered properly.
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Block selection clears before new selection be drawn
Added a call to LineBatch::flush() to ensure that all buffered data is correctly uploaded to the GPU and rendered. The missing flush() was causing rendering artifacts, such as flickering of block outlines, which has now been resolved by ensuring that all accumulated data is processed and rendered properly.
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Redefined the second function argument as a const reference instead of by value to improve performance.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Rearranged structure fields in decreasing order of size to reduce structure size from 32 to 24 and 12 to 8 bytes on 64-bit platforms.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Created references to avoid using repeated expressions, improving performance across multiple instances.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Cached the result of 'glm::vec3(size * 0.63f)' in a temporary variable to avoid multiple identical function calls and improve performance.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
The 'empty()' method is more efficient for checking if a string is empty compared to comparing it with an empty string literal.
The default constructor 'std::wstring()' is more efficient for creating an empty string compared to using a string literal.
The 'clear()' method is more efficient for clearing a std::wstring compared to assigning it an empty string literal.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Replaced copying of the 'sources' variable with move semantics to improve performance.
By moving instead of copying, we avoid unnecessary copying of data and enhance efficiency.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Creating variables in a more localized scope can enhance performance and make the code easier to understand.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Replaced 'std::optional::value()' with '*' operator to improve performance.
Using 'std::optional::value()' involves additional overhead compared to using the '*' or '->' operators. This change ensures more efficient access to the underlying value of the optional when you are certain that it contains a value.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Replaced 'at()' method with 'operator[]' to improve performance.
The 'at()' method performs bounds checking, which can introduce overhead. Using 'operator[]' bypasses this check and can improve performance when you are certain that the index is within bounds.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Passing cheap-to-copy arguments by reference can sometimes lead to decreased performance. This change ensures that the argument is passed by value, which is more efficient in cases where the argument is inexpensive to copy.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Replaced 'emplace' with 'try_emplace' to avoid unnecessary copies or moves when insertion fails.
The 'emplace' function does not guarantee that arguments will not be copied or moved if insertion is not successful. Using 'try_emplace' ensures that arguments are only copied or moved if the insertion actually takes place, thus improving performance.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
The 'current.reset(lang.release())' expression is equivalent to 'current = std::move(lang)'.
Changed 'current.reset(lang.release())' to 'current = std::move(lang)' to improve code clarity and performance.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
It's better to use '= default;' syntax instead of empty constructor and destructor body.
Using '= default;' can help the compiler generate more optimal code.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
Expression's value is copied at variable declaration.
The variable is never modified. Consider declaring it as a reference.
Changed variables to be a reference to avoid unnecessary copy.
Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>