[libshumate] map-layer: Trivial cleanup
- From: Corentin Noël <corentinnoel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libshumate] map-layer: Trivial cleanup
- Date: Wed, 10 Mar 2021 07:51:18 +0000 (UTC)
commit e8e7feef6f2e5afe9a4dec4cf1265a4e4bf20d23
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Mar 5 18:14:54 2021 -0300
map-layer: Trivial cleanup
Replace the else condition with a continue in the if(), and
reduce indentation.
shumate/shumate-map-layer.c | 45 ++++++++++++++++++++++-----------------------
1 file changed, 22 insertions(+), 23 deletions(-)
---
diff --git a/shumate/shumate-map-layer.c b/shumate/shumate-map-layer.c
index 009ddb9..b1e25d1 100644
--- a/shumate/shumate-map-layer.c
+++ b/shumate/shumate-map-layer.c
@@ -404,32 +404,31 @@ shumate_map_layer_size_allocate (GtkWidget *widget,
if (!tile_child)
{
g_critical ("Unable to find tile at (%u;%u)", x, y);
+ continue;
}
- else
- {
- child = tile_child->tile;
- gtk_widget_measure (GTK_WIDGET (child), GTK_ORIENTATION_HORIZONTAL, 0, NULL, NULL, NULL, NULL);
- gtk_widget_size_allocate (GTK_WIDGET (child), &child_allocation, baseline);
+ child = tile_child->tile;
- if (shumate_tile_get_zoom_level (child) != zoom_level ||
- shumate_tile_get_x (child) != (tile_x % source_columns) ||
- shumate_tile_get_y (child) != (tile_y % source_rows) ||
- shumate_tile_get_state (child) == SHUMATE_STATE_NONE)
- {
- GCancellable *cancellable = g_hash_table_lookup (self->tile_fill, child);
- if (cancellable)
- g_cancellable_cancel (cancellable);
-
- shumate_tile_set_zoom_level (child, zoom_level);
- shumate_tile_set_x (child, tile_x % source_columns);
- shumate_tile_set_y (child, tile_y % source_rows);
-
- cancellable = g_cancellable_new ();
- shumate_tile_set_texture (child, NULL);
- shumate_map_source_fill_tile (self->map_source, child, cancellable);
- g_hash_table_insert (self->tile_fill, g_object_ref (child), cancellable);
- }
+ gtk_widget_measure (GTK_WIDGET (child), GTK_ORIENTATION_HORIZONTAL, 0, NULL, NULL, NULL, NULL);
+ gtk_widget_size_allocate (GTK_WIDGET (child), &child_allocation, baseline);
+
+ if (shumate_tile_get_zoom_level (child) != zoom_level ||
+ shumate_tile_get_x (child) != (tile_x % source_columns) ||
+ shumate_tile_get_y (child) != (tile_y % source_rows) ||
+ shumate_tile_get_state (child) == SHUMATE_STATE_NONE)
+ {
+ GCancellable *cancellable = g_hash_table_lookup (self->tile_fill, child);
+ if (cancellable)
+ g_cancellable_cancel (cancellable);
+
+ shumate_tile_set_zoom_level (child, zoom_level);
+ shumate_tile_set_x (child, tile_x % source_columns);
+ shumate_tile_set_y (child, tile_y % source_rows);
+
+ cancellable = g_cancellable_new ();
+ shumate_tile_set_texture (child, NULL);
+ shumate_map_source_fill_tile (self->map_source, child, cancellable);
+ g_hash_table_insert (self->tile_fill, g_object_ref (child), cancellable);
}
child_allocation.y += tile_size;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]