WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/21/2019 12:48:29 PM (3 months ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Use the ** operator instead of the pow() function in wp_convert_bytes_to_hr() for better performance.

Use the MB_IN_BYTES constant instead of the pow() function in WP_Customize_Manager::_validate_header_video() for better readability.

Props ayeshrajans, jrf.
Fixes #48083.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/deprecated.php

    r46129 r46225  
    33473347    $log   = log( $bytes, KB_IN_BYTES );
    33483348    $power = (int) $log;
    3349     $size  = pow( KB_IN_BYTES, $log - $power );
     3349    $size  = KB_IN_BYTES ** ( $log - $power );
    33503350
    33513351    if ( ! is_nan( $size ) && array_key_exists( $power, $units ) ) {
Note: See TracChangeset for help on using the changeset viewer.