[libstdc++] Remove unused hasher instance.

Message ID 20210604195156.706986-1-rodgert@appliantology.com
State New
Headers show
Series
  • [libstdc++] Remove unused hasher instance.
Related show

Commit Message

Thomas Rodgers June 4, 2021, 7:51 p.m.
This is a remnant of poorly executed refactoring.

libstdc++-v3/ChangeLog:

	* include/std/barrier (__tree_barrier::_M_arrive): Remove
        unnecessary hasher instantiation.
---
 libstdc++-v3/include/std/barrier | 1 -
 1 file changed, 1 deletion(-)

-- 
2.26.2

Comments

Jonathan Wakely via Gcc-patches June 4, 2021, 8:30 p.m. | #1
On Fri, 4 Jun 2021 at 20:54, Thomas Rodgers wrote:

> This is a remnant of poorly executed refactoring.

>


OK for trunk and gcc-11, thanks.



> libstdc++-v3/ChangeLog:

>

>         * include/std/barrier (__tree_barrier::_M_arrive): Remove

>         unnecessary hasher instantiation.

> ---

>  libstdc++-v3/include/std/barrier | 1 -

>  1 file changed, 1 deletion(-)

>

> diff --git a/libstdc++-v3/include/std/barrier

> b/libstdc++-v3/include/std/barrier

> index fd61fb4f9da..4210e30d1ce 100644

> --- a/libstdc++-v3/include/std/barrier

> +++ b/libstdc++-v3/include/std/barrier

> @@ -103,7 +103,6 @@ It looks different from literature pseudocode for two

> main reasons:

>                            static_cast<__barrier_phase_t>(__old_phase_val

> + 2);

>

>         size_t __current_expected = _M_expected;

> -       std::hash<std::thread::id> __hasher;

>         __current %= ((_M_expected + 1) >> 1);

>

>         for (int __round = 0; ; ++__round)

> --

> 2.26.2

>

>
Jonathan Wakely via Gcc-patches June 8, 2021, 11:04 p.m. | #2
Tested x86_64-pc-linux-gnu, committed to master, backported to
releases/gcc-11.

On Fri, Jun 4, 2021 at 1:30 PM Jonathan Wakely <jwakely@redhat.com> wrote:

>

>

> On Fri, 4 Jun 2021 at 20:54, Thomas Rodgers wrote:

>

>> This is a remnant of poorly executed refactoring.

>>

>

> OK for trunk and gcc-11, thanks.

>

>

>

>> libstdc++-v3/ChangeLog:

>>

>>         * include/std/barrier (__tree_barrier::_M_arrive): Remove

>>         unnecessary hasher instantiation.

>> ---

>>  libstdc++-v3/include/std/barrier | 1 -

>>  1 file changed, 1 deletion(-)

>>

>> diff --git a/libstdc++-v3/include/std/barrier

>> b/libstdc++-v3/include/std/barrier

>> index fd61fb4f9da..4210e30d1ce 100644

>> --- a/libstdc++-v3/include/std/barrier

>> +++ b/libstdc++-v3/include/std/barrier

>> @@ -103,7 +103,6 @@ It looks different from literature pseudocode for two

>> main reasons:

>>                            static_cast<__barrier_phase_t>(__old_phase_val

>> + 2);

>>

>>         size_t __current_expected = _M_expected;

>> -       std::hash<std::thread::id> __hasher;

>>         __current %= ((_M_expected + 1) >> 1);

>>

>>         for (int __round = 0; ; ++__round)

>> --

>> 2.26.2

>>

>>

Patch

diff --git a/libstdc++-v3/include/std/barrier b/libstdc++-v3/include/std/barrier
index fd61fb4f9da..4210e30d1ce 100644
--- a/libstdc++-v3/include/std/barrier
+++ b/libstdc++-v3/include/std/barrier
@@ -103,7 +103,6 @@  It looks different from literature pseudocode for two main reasons:
 			   static_cast<__barrier_phase_t>(__old_phase_val + 2);
 
 	size_t __current_expected = _M_expected;
-	std::hash<std::thread::id> __hasher;
 	__current %= ((_M_expected + 1) >> 1);
 
 	for (int __round = 0; ; ++__round)