Dart - make writeString() argument non-nullable (#6737)

This commit is contained in:
Ivan Dlugos
2021-07-20 16:54:48 +02:00
committed by GitHub
parent 674a9f2aae
commit 2bfc8e9f01
6 changed files with 40 additions and 33 deletions

View File

@@ -668,18 +668,14 @@ class Builder {
return result;
}
/// Write the given string [value] and return its offset, or `null` if
/// the [value] is `null`.
int? writeString(String? value) {
/// Write the given string [value] and return its offset.
int writeString(String value) {
_ensureNoVTable();
if (value != null) {
if (_strings != null) {
return _strings!.putIfAbsent(value, () => _writeString(value));
} else {
return _writeString(value);
}
if (_strings != null) {
return _strings!.putIfAbsent(value, () => _writeString(value));
} else {
return _writeString(value);
}
return null;
}
int _writeString(String value) {