Rename empty() to is_empty()
This commit is contained in:
parent
886571e0fc
commit
5b937d493f
289 changed files with 898 additions and 898 deletions
|
|
@ -67,7 +67,7 @@ void ConfigFile::set_value(const String &p_section, const String &p_key, const V
|
|||
return; // ?
|
||||
}
|
||||
values[p_section].erase(p_key);
|
||||
if (values[p_section].empty()) {
|
||||
if (values[p_section].is_empty()) {
|
||||
values.erase(p_section);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ void FileAccessNetwork::_queue_page(int p_page) const {
|
|||
if (p_page >= pages.size()) {
|
||||
return;
|
||||
}
|
||||
if (pages[p_page].buffer.empty() && !pages[p_page].queued) {
|
||||
if (pages[p_page].buffer.is_empty() && !pages[p_page].queued) {
|
||||
FileAccessNetworkClient *nc = FileAccessNetworkClient::singleton;
|
||||
{
|
||||
MutexLock lock(nc->blockrequest_mutex);
|
||||
|
|
@ -386,7 +386,7 @@ int FileAccessNetwork::get_buffer(uint8_t *p_dst, int p_length) const {
|
|||
|
||||
if (page != last_page) {
|
||||
buffer_mutex.lock();
|
||||
if (pages[page].buffer.empty()) {
|
||||
if (pages[page].buffer.is_empty()) {
|
||||
waiting_on_page = page;
|
||||
for (int j = 0; j < read_ahead; j++) {
|
||||
_queue_page(page + j);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ void PackedData::add_path(const String &pkg_path, const String &path, uint64_t o
|
|||
}
|
||||
String filename = path.get_file();
|
||||
// Don't add as a file if the path points to a directory
|
||||
if (!filename.empty()) {
|
||||
if (!filename.is_empty()) {
|
||||
cd->files.insert(filename);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ Image::Image3DValidateError Image::validate_3d_image(Image::Format p_format, int
|
|||
if (idx >= p_images.size()) {
|
||||
return VALIDATE_3D_ERR_MISSING_IMAGES;
|
||||
}
|
||||
if (p_images[idx].is_null() || p_images[idx]->empty()) {
|
||||
if (p_images[idx].is_null() || p_images[idx]->is_empty()) {
|
||||
return VALIDATE_3D_ERR_IMAGE_EMPTY;
|
||||
}
|
||||
if (p_images[idx]->get_format() != p_format) {
|
||||
|
|
@ -1756,7 +1756,7 @@ Error Image::generate_mipmap_roughness(RoughnessChannel p_roughness_channel, con
|
|||
double *normal_sat = nullptr; //summed area table for normalmap
|
||||
int normal_w = 0, normal_h = 0;
|
||||
|
||||
ERR_FAIL_COND_V_MSG(p_normal_map.is_null() || p_normal_map->empty(), ERR_INVALID_PARAMETER, "Must provide a valid normalmap for roughness mipmaps");
|
||||
ERR_FAIL_COND_V_MSG(p_normal_map.is_null() || p_normal_map->is_empty(), ERR_INVALID_PARAMETER, "Must provide a valid normalmap for roughness mipmaps");
|
||||
|
||||
Ref<Image> nm = p_normal_map->duplicate();
|
||||
if (nm->is_compressed()) {
|
||||
|
|
@ -1950,7 +1950,7 @@ void Image::clear_mipmaps() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (empty()) {
|
||||
if (is_empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1961,7 +1961,7 @@ void Image::clear_mipmaps() {
|
|||
mipmaps = false;
|
||||
}
|
||||
|
||||
bool Image::empty() const {
|
||||
bool Image::is_empty() const {
|
||||
return (data.size() == 0);
|
||||
}
|
||||
|
||||
|
|
@ -3090,7 +3090,7 @@ void Image::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("create", "width", "height", "use_mipmaps", "format"), &Image::_create_empty);
|
||||
ClassDB::bind_method(D_METHOD("create_from_data", "width", "height", "use_mipmaps", "format", "data"), &Image::_create_from_data);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("is_empty"), &Image::empty);
|
||||
ClassDB::bind_method(D_METHOD("is_empty"), &Image::is_empty);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("load", "path"), &Image::load);
|
||||
ClassDB::bind_method(D_METHOD("save_png", "path"), &Image::save_png);
|
||||
|
|
@ -3585,7 +3585,7 @@ Image::Image(const uint8_t *p_mem_png_jpg, int p_len) {
|
|||
copy_internals_from(_png_mem_loader_func(p_mem_png_jpg, p_len));
|
||||
}
|
||||
|
||||
if (empty() && _jpg_mem_loader_func) {
|
||||
if (is_empty() && _jpg_mem_loader_func) {
|
||||
copy_internals_from(_jpg_mem_loader_func(p_mem_png_jpg, p_len));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ public:
|
|||
/**
|
||||
* returns true when the image is empty (0,0) in size
|
||||
*/
|
||||
bool empty() const;
|
||||
bool is_empty() const;
|
||||
|
||||
Vector<uint8_t> get_data() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ void IP::erase_resolve_item(ResolverID p_id) {
|
|||
void IP::clear_cache(const String &p_hostname) {
|
||||
MutexLock lock(resolver->mutex);
|
||||
|
||||
if (p_hostname.empty()) {
|
||||
if (p_hostname.is_empty()) {
|
||||
resolver->cache.clear();
|
||||
} else {
|
||||
resolver->cache.erase(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_NONE));
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ const char *JSON::tk_name[TK_MAX] = {
|
|||
|
||||
static String _make_indent(const String &p_indent, int p_size) {
|
||||
String indent_text = "";
|
||||
if (!p_indent.empty()) {
|
||||
if (!p_indent.is_empty()) {
|
||||
for (int i = 0; i < p_size; i++) {
|
||||
indent_text += p_indent;
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_
|
|||
String colon = ":";
|
||||
String end_statement = "";
|
||||
|
||||
if (!p_indent.empty()) {
|
||||
if (!p_indent.is_empty()) {
|
||||
colon += " ";
|
||||
end_statement += "\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ void PCKPacker::_bind_methods() {
|
|||
}
|
||||
|
||||
Error PCKPacker::pck_start(const String &p_file, int p_alignment, const String &p_key, bool p_encrypt_directory) {
|
||||
ERR_FAIL_COND_V_MSG((p_key.empty() || !p_key.is_valid_hex_number(false) || p_key.length() != 64), ERR_CANT_CREATE, "Invalid Encryption Key (must be 64 characters long).");
|
||||
ERR_FAIL_COND_V_MSG((p_key.is_empty() || !p_key.is_valid_hex_number(false) || p_key.length() != 64), ERR_CANT_CREATE, "Invalid Encryption Key (must be 64 characters long).");
|
||||
|
||||
String _key = p_key.to_lower();
|
||||
key.resize(32);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) {
|
|||
is_eof = f->eof_reached();
|
||||
|
||||
// If we reached last line and it's not a content line, break, otherwise let processing that last loop
|
||||
if (is_eof && l.empty()) {
|
||||
if (is_eof && l.is_empty()) {
|
||||
if (status == STATUS_READING_ID || status == STATUS_READING_CONTEXT || (status == STATUS_READING_PLURAL && plural_index != plural_forms - 1)) {
|
||||
memdelete(f);
|
||||
ERR_FAIL_V_MSG(RES(), "Unexpected EOF while reading PO file at: " + path + ":" + itos(line));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue