Skip to content

Commit 7115159

Browse files
committed
clang-tidy fix
1 parent e70b38b commit 7115159

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/pybind11/gil.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class gil_scoped_acquire {
1919
PyGILState_STATE state;
2020

2121
public:
22-
gil_scoped_acquire() { state = PyGILState_Ensure(); }
22+
gil_scoped_acquire() : state{PyGILState_Ensure()} {}
2323
gil_scoped_acquire(const gil_scoped_acquire &) = delete;
2424
gil_scoped_acquire &operator=(const gil_scoped_acquire &) = delete;
2525
~gil_scoped_acquire() { PyGILState_Release(state); }
@@ -30,7 +30,7 @@ class gil_scoped_release {
3030
PyThreadState *state;
3131

3232
public:
33-
gil_scoped_release() { state = PyEval_SaveThread(); }
33+
gil_scoped_release() : state{PyEval_SaveThread()} {}
3434
gil_scoped_release(const gil_scoped_release &) = delete;
3535
gil_scoped_release &operator=(const gil_scoped_acquire &) = delete;
3636
~gil_scoped_release() { PyEval_RestoreThread(state); }

0 commit comments

Comments
 (0)