Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using optimized funcs std::find, strchr with char param, constexpr calc len out-of-loop #791

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GermanAizek
Copy link

No description provided.

@JablonskiMateusz
Copy link
Contributor

please update year in copyright header in modified files

…f-loop

Signed-off-by: Semenov Herman (Семенов Герман) <[email protected]>
@GermanAizek
Copy link
Author

please update year in copyright header in modified files

fixed it this e2db055

@@ -659,15 +659,17 @@ std::vector<std::unique_ptr<HwDeviceId>> Drm::discoverDevices(ExecutionEnvironme

do {
const char *renderDeviceSuffix = "-render";
constexpr size_t renderDevSufSize = std::char_traits<char>::length(renderDeviceSuffix);
constexpr size_t pciDevDirLen = std::char_traits<char>::length(Os::pciDevicesDirectory);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Os::pciDevicesDirectory is not known at compile time as it is defined differently for ULT and for runtime, hence the size cannot be constexpr

@@ -659,15 +659,17 @@ std::vector<std::unique_ptr<HwDeviceId>> Drm::discoverDevices(ExecutionEnvironme

do {
const char *renderDeviceSuffix = "-render";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const char *renderDeviceSuffix = "-render";
constexpr const char *renderDeviceSuffix = "-render";

to allow compile time size calculation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants