We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d4bf5c commit cc89b20Copy full SHA for cc89b20
1 file changed
core/src/processing/data/Table.java
@@ -3435,9 +3435,18 @@ public void replace(String orig, String replacement) {
3435
public void replace(String orig, String replacement, int col) {
3436
if (columnTypes[col] == STRING) {
3437
String[] stringData = (String[]) columns[col];
3438
- for (int row = 0; row < rowCount; row++) {
3439
- if (stringData[row].equals(orig)) {
3440
- stringData[row] = replacement;
+
+ if (orig != null) {
+ for (int row = 0; row < rowCount; row++) {
3441
+ if (orig.equals(stringData[row])) {
3442
+ stringData[row] = replacement;
3443
+ }
3444
3445
+ } else { // null is a special case (and faster anyway)
3446
3447
+ if (stringData[row] == null) {
3448
3449
3450
}
3451
3452
0 commit comments