refactor: make TrackableObject::weak_map_id() constexpr (#47115)

* refactor: make TrackableObject::weak_map_id() constexpr

refactor: make BaseWindow::GetID() inline and constexpr

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: make NativeWindow::window_id() constexpr too

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2025-05-15 19:38:34 -05:00 committed by GitHub
commit 7cb5a46b66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 3 additions and 7 deletions

View file

@ -261,7 +261,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
void SetTitleBarOverlay(const gin_helper::Dictionary& options,
gin_helper::Arguments* args);
#endif
int32_t GetID() const;
[[nodiscard]] constexpr int32_t GetID() const { return weak_map_id(); }
private:
// Helpers.