File tree 1 file changed +4
-10
lines changed
1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -560,11 +560,8 @@ func (c *Conn) execSend(query string) error {
560
560
func (c * Conn ) CapabilityString () string {
561
561
capability := c .capability
562
562
caps := make ([]string , 0 , bits .OnesCount32 (capability ))
563
- for i := 0 ; capability != 0 ; i ++ {
564
- field := uint32 (1 << i )
565
- if capability & field == 0 {
566
- continue
567
- }
563
+ for capability != 0 {
564
+ field := uint32 (1 << bits .TrailingZeros32 (capability ))
568
565
capability ^= field
569
566
570
567
switch field {
@@ -645,11 +642,8 @@ func (c *Conn) CapabilityString() string {
645
642
func (c * Conn ) StatusString () string {
646
643
status := c .status
647
644
stats := make ([]string , 0 , bits .OnesCount16 (status ))
648
- for i := 0 ; status != 0 ; i ++ {
649
- field := uint16 (1 << i )
650
- if status & field == 0 {
651
- continue
652
- }
645
+ for status != 0 {
646
+ field := uint16 (1 << bits .TrailingZeros16 (status ))
653
647
status ^= field
654
648
655
649
switch field {
You can’t perform that action at this time.
0 commit comments