<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>250802</bug_id>
          
          <creation_ts>2023-01-18 15:54:54 -0800</creation_ts>
          <short_desc>Remove duplicate isLeapYear</short_desc>
          <delta_ts>2023-01-19 05:37:16 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Template Framework</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Ahmad Saleem">ahmad.saleem792</assigned_to>
          <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1926448</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-01-18 15:54:54 -0800</bug_when>
    <thetext>Hi Team,

I came across another refactoring patch to remove duplicate function:

Blink Commit - https://chromium.googlesource.com/chromium/blink/+/ecbe8115cc1f014eb61dff29b96e405a0ab3ef51

WebKit Source - https://searchfox.org/wubkat/source/Source/WTF/wtf/DateMath.h#188 &amp; https://searchfox.org/wubkat/source/Source/WebCore/platform/DateComponents.cpp#56

We have two functions exactly same, one is inline while another is static.

Can we get rid of one?

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926455</commentid>
    <comment_count>1</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2023-01-18 16:23:47 -0800</bug_when>
    <thetext>Yes! Use the one in WTF/DateMath.h and delete the other one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926472</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2023-01-18 16:35:47 -0800</bug_when>
    <thetext>It would be nice to move other generic functions as well, and unify duplicates (like daysInMonths in ISO8601.cpp). But that would be a much larger effort.

static int maxDayOfMonth(int year, int month)
static int dayOfWeek(int year, int month, int day)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926473</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-01-18 16:36:59 -0800</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #2)
&gt; It would be nice to move other generic functions as well, and unify
&gt; duplicates (like daysInMonths in ISO8601.cpp). But that would be a much
&gt; larger effort.
&gt; 
&gt; static int maxDayOfMonth(int year, int month)
&gt; static int dayOfWeek(int year, int month, int day)

Should I create a bug for future?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926474</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-01-18 16:37:12 -0800</bug_when>
    <thetext>(In reply to Brent Fulgham from comment #1)
&gt; Yes! Use the one in WTF/DateMath.h and delete the other one.

Happy to do PR. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926479</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2023-01-18 16:47:27 -0800</bug_when>
    <thetext>&gt; Should I create a bug for future?

I personally wouldn&apos;t bother (refactoring ideas don&apos;t usually get acted on), but it wouldn&apos;t be unreasonable to do if you feel like it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926483</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-01-18 16:54:12 -0800</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #5)
&gt; &gt; Should I create a bug for future?
&gt; 
&gt; I personally wouldn&apos;t bother (refactoring ideas don&apos;t usually get acted on),
&gt; but it wouldn&apos;t be unreasonable to do if you feel like it.

Not in near future (few weeks), still learning few bits around WebKit but in few months, I can explore it as a challenge. I will add it in my To-do Notes. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926488</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-01-18 17:07:57 -0800</bug_when>
    <thetext>PR - https://github.com/WebKit/WebKit/pull/8806</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926580</commentid>
    <comment_count>8</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-01-19 05:36:50 -0800</bug_when>
    <thetext>Committed 259080@main (0b9c23b10f38): &lt;https://commits.webkit.org/259080@main&gt;

Reviewed commits have been landed. Closing PR #8806 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926581</commentid>
    <comment_count>9</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-01-19 05:37:16 -0800</bug_when>
    <thetext>&lt;rdar://problem/104425042&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>