<commit_before>package com.larvalabs.svgandroid;


/*
 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
 * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
 * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
 * applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
/**
 * Parses numbers from SVG text. Based on the Batik Number Parser (Apache 2 License).
 * 
 * @author Apache Software Foundation, Larva Labs LLC
 */
public class ParserHelper {

	private char current;
	private CharSequence s;
	public int pos;
	private int n;

	public ParserHelper(CharSequence s, int pos) {
		this.s = s;
		this.pos = pos;
		n = s.length();
		current = s.charAt(pos);
	}

	private char read() {
		if (pos < n) {
			pos++;
		}
		if (pos == n) {
			return '\0';
		} else {
			return s.charAt(pos);
		}
	}

	public void skipWhitespace() {
		while (pos < n) {
			if (Character.isWhitespace(s.charAt(pos))) {
				advance();
			} else {
				break;
			}
		}
	}

	public void skipNumberSeparator() {
		while (pos < n) {
			char c = s.charAt(pos);<commit_msg>ParserHelper.read() performance increased by 90%. Total increase 13%.<commit_after>package com.larvalabs.svgandroid;

import java.lang.reflect.Field;

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
 * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
 * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
 * applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
/**
 * Parses numbers from SVG text. Based on the Batik Number Parser (Apache 2 License).
 * 
 * @author Apache Software Foundation, Larva Labs LLC
 */
public class ParserHelper {

	private static final Field STRING_CHARS;
	static {
		try {
			STRING_CHARS = String.class.getDeclaredField("value");
			STRING_CHARS.setAccessible(true);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	private final char[] s;
	private final int n;
	private char current;
	public int pos;

	public ParserHelper(String str, int pos) {
		try {
			this.s = (char[]) STRING_CHARS.get(str);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
		this.pos = pos;
		n = s.length;
		current = s[pos];
	}

	private char read() {
		if (pos < n) {
			pos++;
		}
		if (pos == n) {
			return '\0';
		} else {
			return s[pos];
		}
	}

	public void skipWhitespace() {
		while (pos < n) {
			if (Character.isWhitespace(s[pos])) {
				advance();
			} else {
				break;
			}
		}
	}

	public void skipNumberSeparator() {
		while (pos < n) {
			char c = s[pos];
{'fraction_non_alphanumeric': 0.09700866648029075, 'fraction_numerical': 0.004473022085546547, 'mean_word_length': 3.5062972292191437, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3136260', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1046, 'n_words': 430}