From d94239509455ed1dfa30c58a86ef4bb213ff6f63 Mon Sep 17 00:00:00 2001 From: Ruth Comer <10599679+rcomer@users.noreply.github.com> Date: Sat, 10 Feb 2024 09:36:25 +0000 Subject: [PATCH] Simplify if loop Co-authored-by: Greg Lucas --- lib/cartopy/mpl/feature_artist.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/cartopy/mpl/feature_artist.py b/lib/cartopy/mpl/feature_artist.py index 2774d293e..c3d098c79 100644 --- a/lib/cartopy/mpl/feature_artist.py +++ b/lib/cartopy/mpl/feature_artist.py @@ -191,10 +191,8 @@ def draw(self, renderer, *args, **kwargs): geom_paths = cpatch.geos_to_path(projected_geom) if not geom_paths: continue - elif len(geom_paths) > 1: - geom_path = mpath.Path.make_compound_path(*geom_paths) - else: - geom_path, = geom_paths + # The transform may have split the geometry into two paths, we only want one compound path + geom_path = mpath.Path.make_compound_path(*geom_paths) mapping[key] = geom_path if not self._styler: