mirror of
https://github.com/revanced/jadb.git
synced 2024-06-10 15:17:52 +02:00
PropertyManager's pattern only needs to be compiled once
According to Pattern docs "Instances of this class are immutable and are safe for use by multiple concurrent threads."
This commit is contained in:
parent
206b9c4352
commit
a083481f4a
|
@ -15,6 +15,7 @@ import java.util.regex.Pattern;
|
|||
* A class which works with properties, uses getprop and setprop methods of android shell
|
||||
*/
|
||||
public class PropertyManager {
|
||||
private final Pattern pattern = Pattern.compile("^\\[([a-zA-Z0-9_.-]*)\\]:.\\[([^\\[\\]]*)\\]");
|
||||
private final JadbDevice device;
|
||||
|
||||
public PropertyManager(JadbDevice device) {
|
||||
|
@ -27,8 +28,6 @@ public class PropertyManager {
|
|||
}
|
||||
|
||||
private Map<String, String> parseProp(BufferedReader bufferedReader) throws IOException {
|
||||
final Pattern pattern = Pattern.compile("^\\[([a-zA-Z0-9_.-]*)\\]:.\\[([^\\[\\]]*)\\]");
|
||||
|
||||
HashMap<String, String> result = new HashMap<>();
|
||||
|
||||
String line;
|
||||
|
|
Loading…
Reference in New Issue
Block a user