Fix minor performance issues with variable copy by nrspruit · Pull Request #394 · oneapi-src/level-zero

Pull request overview

This PR optimizes performance by reducing unnecessary data copying in the loader and validation layers. The changes implement move semantics and const references where appropriate to avoid redundant object copies.

Key Changes:

  • Applied std::move() to transfer driver vector ownership instead of copying
  • Changed loop variables to use const references to avoid copying objects during iteration

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
source/loader/ze_loader.cpp Optimized driver vector assignment using move semantics and loop iteration using const reference
source/layers/validation/checkers/basic_leak/zel_basic_leak_checker.cpp Changed loop variable to const reference to avoid unnecessary copies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.