Changeset 2860

Show
Ignore:
Timestamp:
11/24/08 03:24:49 (7 weeks ago)
Author:
bjohnson
Message:

A small efficiency fix for the Bitmask class.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/system/classes/bitmask.php

    r2859 r2860  
    4747                } 
    4848                if ( $on ) { 
    49                     $this->value |= pow( 2, $bit ); 
     49                    $this->value |= 1 << $bit; 
    5050                } 
    5151                else { 
    52                     $this->value &= ~pow( 2, $bit ); 
     52                    $this->value &= ~(1 << $bit); 
    5353                } 
    5454                break; 
    55         } 
    56     return $on; 
    57   } 
     55            } 
     56        return $on; 
     57    } 
    5858 
    5959    /** 
     
    6969        if ( $bit === false ) 
    7070            return false; 
    71         return $this->value & pow(2, $bit); 
     71        return $this->value & (1 << $bit ); 
    7272    } 
    7373