Skip to content

Commit

Permalink
Editorial: avoid setting encoding multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed May 23, 2018
1 parent acc2bf4 commit b385374
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions url.bs
Expand Up @@ -2105,16 +2105,22 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
<dt><dfn>query state</dfn>
<dd>
<ol>
<li>
<p>If <var>encoding</var> is not <a>UTF-8</a> and one of the following is true

<ul class=brief>
<li><p><var>url</var> <a lt="is special">is not special</a>
<li><p><var>url</var>'s <a for=url>scheme</a> is "<code>ws</code>" or "<code>wss</code>"
</ul>

<p>then set <var>encoding</var> to <a>UTF-8</a>.
<!-- https://simon.html5.org/test/url/url-encoding.html -->

<li>
<p>If <a>c</a> is the <a>EOF code point</a>, or <var>state override</var> is not given and
<a>c</a> is U+0023 (#), then:

<ol>
<li><p>If <var>url</var> <a lt="is special">is <em>not</em> special</a> or <var>url</var>'s
<a for=url>scheme</a> is either "<code>ws</code>" or "<code>wss</code>", set
<var>encoding</var> to <a>UTF-8</a>.
<!-- https://simon.html5.org/test/url/url-encoding.html -->

<li><p>Set <var>buffer</var> to the result of <a lt=encode>encoding</a> <var>buffer</var>
using <var>encoding</var>.

Expand Down

4 comments on commit b385374

@GPHemsley
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem editorial to me...

@annevk
Copy link
Member Author

@annevk annevk commented on b385374 Jun 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is it observable?

@GPHemsley
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, any change to the algorithm is non-editorial, regardless of whether it's observable in the final output. And besides, if it wasn't observable, why concern yourself with the fact that you're "setting encoding multiple times"?

@annevk
Copy link
Member Author

@annevk annevk commented on b385374 Jun 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we'll have to disagree on that. Refactoring algorithms is fine and is considered editorial unless it affects implementations.

Please sign in to comment.