Skip to content

Commit 590e7ce

Browse files
committed
Remove cch parameter for CountNewlines in Scan.cpp
As commented by sethbrenith, all callers do not pass cch and use default -1, so there's no need to keep cch.
1 parent fc1fb6a commit 590e7ce

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/Parser/Scan.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,18 @@
1010
* a given character can be part of an identifier, and so on.
1111
*/
1212

13-
int CountNewlines(LPCOLESTR psz, int cch)
13+
int CountNewlines(LPCOLESTR psz)
1414
{
1515
int cln = 0;
1616

17-
while (0 != *psz && 0 != cch--)
17+
while (0 != *psz)
1818
{
1919
switch (*psz++)
2020
{
2121
case _u('\xD'):
22-
if (cch != 0 && *psz == _u('\xA'))
22+
if (*psz == _u('\xA'))
2323
{
2424
++psz;
25-
--cch;
2625
}
2726
// fall-through
2827
case _u('\xA'):

lib/Parser/Scan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Js
1212
#include "Windows.Globalization.h"
1313
#endif
1414

15-
int CountNewlines(LPCOLESTR psz, int cch = -1);
15+
int CountNewlines(LPCOLESTR psz);
1616

1717
class Parser;
1818
struct ParseContext;

0 commit comments

Comments
 (0)