⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268797 in webkit


Ignore:
Timestamp:
Oct 21, 2020, 9:15:56 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Un-needed casts in Screen::{width,height}()
https://bugs.webkit.org/show_bug.cgi?id=218013

Patch by Philippe Normand <pnormand@igalia.com> on 2020-10-21
Reviewed by Darin Adler.

  • page/Screen.cpp:

(WebCore::Screen::height const): There is no need to convert from float to long and then
unsigned.
(WebCore::Screen::width const): Ditto.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r268792 r268797  
     12020-10-21  Philippe Normand  <pnormand@igalia.com>
     2
     3        Un-needed casts in Screen::{width,height}()
     4        https://bugs.webkit.org/show_bug.cgi?id=218013
     5
     6        Reviewed by Darin Adler.
     7
     8        * page/Screen.cpp:
     9        (WebCore::Screen::height const): There is no need to convert from float to long and then
     10        unsigned.
     11        (WebCore::Screen::width const): Ditto.
     12
    1132020-10-20  Sergio Villar Senin  <svillar@igalia.com>
    214
  • trunk/Source/WebCore/page/Screen.cpp

    r268716 r268797  
    5858    if (RuntimeEnabledFeatures::sharedFeatures().webAPIStatisticsEnabled())
    5959        ResourceLoadObserver::shared().logScreenAPIAccessed(*frame->document(), ResourceLoadStatistics::ScreenAPI::Height);
    60     long height = static_cast<long>(frame->screenSize().height());
    61     return static_cast<unsigned>(height);
     60    return static_cast<unsigned>(frame->screenSize().height());
    6261}
    6362
     
    6968    if (RuntimeEnabledFeatures::sharedFeatures().webAPIStatisticsEnabled())
    7069        ResourceLoadObserver::shared().logScreenAPIAccessed(*frame->document(), ResourceLoadStatistics::ScreenAPI::Width);
    71     long width = static_cast<long>(frame->screenSize().width());
    72     return static_cast<unsigned>(width);
     70    return static_cast<unsigned>(frame->screenSize().width());
    7371}
    7472
Note: See TracChangeset for help on using the changeset viewer.