-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Thank you for this module, which is working well for me! Looking at the source, I noticed that the user search is generally my ($user) = ...->all():
Dancer2-Plugin-Auth-Extensible-Provider-DBIC/lib/Dancer2/Plugin/Auth/Extensible/Provider/DBIC.pm
Line 603 in 5296ad3
| my ( $user ) = $self->_user_rset( 'username', $username )->all; |
Dancer2-Plugin-Auth-Extensible-Provider-DBIC/lib/Dancer2/Plugin/Auth/Extensible/Provider/DBIC.pm
Line 667 in 5296ad3
| my ($user) = $users_rs->all; |
Dancer2-Plugin-Auth-Extensible-Provider-DBIC/lib/Dancer2/Plugin/Auth/Extensible/Provider/DBIC.pm
Line 690 in 5296ad3
| my ($user) = $self->_user_rset( pw_reset_code => $code )->all; |
Dancer2-Plugin-Auth-Extensible-Provider-DBIC/lib/Dancer2/Plugin/Auth/Extensible/Provider/DBIC.pm
Line 718 in 5296ad3
| my ($user) = $self->_user_rset(username => $username)->all; |
Dancer2-Plugin-Auth-Extensible-Provider-DBIC/lib/Dancer2/Plugin/Auth/Extensible/Provider/DBIC.pm
Line 802 in 5296ad3
| my ($user) = $self->_user_rset(username => $username, $options)->all; |
DBIx::Class::ResultSet::single() claims to avoid creating a cursor if there's only one result. Since we only keep one result anyway, would it be worth using single() for speed? If not, would you please let me know the details for my own understanding?
Alternatively, would my $user = ...->first improve code clarity?
Thanks for considering this request!