mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-0 avoid unnecessary DB write for DBStringMapAdapter
This commit is contained in:
parent
cd4452ace9
commit
61a2b8335c
1 changed files with 5 additions and 0 deletions
|
@ -19,6 +19,8 @@ import java.io.IOException;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import db.*;
|
import db.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,6 +50,9 @@ public class DBStringMapAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void put(String key, String value) throws IOException {
|
public void put(String key, String value) throws IOException {
|
||||||
|
if (StringUtils.equals(value, get(key))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
DBRecord record = SCHEMA.createRecord(new StringField(key));
|
DBRecord record = SCHEMA.createRecord(new StringField(key));
|
||||||
record.setString(0, value);
|
record.setString(0, value);
|
||||||
table.putRecord(record);
|
table.putRecord(record);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue