Skip to content
Permalink
Browse files

Editorial: avoid setting encoding multiple times

  • Loading branch information...
annevk committed May 9, 2018
1 parent acc2bf4 commit b385374e5d1b48f82b8040395786469ae655f435
Showing with 11 additions and 5 deletions.
  1. +11 −5 url.bs
16 url.bs
@@ -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>.

4 comments on commit b385374

@GPHemsley

This comment has been minimized.

Copy link
Member

replied Jun 24, 2018

This doesn't seem editorial to me...

@annevk

This comment has been minimized.

Copy link
Member Author

replied Jun 24, 2018

How is it observable?

@GPHemsley

This comment has been minimized.

Copy link
Member

replied Jun 24, 2018

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

This comment has been minimized.

Copy link
Member Author

replied Jun 24, 2018

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.
You can’t perform that action at this time.