MCPcopy Index your code
hub / github.com/apache/tomcat / nthSlash

Method nthSlash

java/org/apache/catalina/mapper/Mapper.java:1447–1461  ·  view source on GitHub ↗

Find the position of the nth slash, in the given char chunk.

(CharChunk name, int n)

Source from the content-addressed store, hash-verified

1445 * Find the position of the nth slash, in the given char chunk.
1446 */
1447 private static int nthSlash(CharChunk name, int n) {
1448 char[] c = name.getBuffer();
1449 int end = name.getEnd();
1450 int pos = name.getStart();
1451 int count = 0;
1452
1453 while (pos < end) {
1454 if ((c[pos++] == '/') && ((++count) == n)) {
1455 pos--;
1456 break;
1457 }
1458 }
1459
1460 return pos;
1461 }
1462
1463
1464 /**

Callers 2

internalMapMethod · 0.95

Calls 3

getBufferMethod · 0.65
getEndMethod · 0.45
getStartMethod · 0.45

Tested by

no test coverage detected