summaryrefslogtreecommitdiff
path: root/sql/spatial.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-04-04 12:16:12 +0300
committerMonty <monty@mariadb.org>2018-05-07 00:07:32 +0300
commit30ebc3ee9efcab635b1f3e14b9198a58ae93c233 (patch)
tree81e3ad66cd4ec8693964317cbf23515d0e9ecf35 /sql/spatial.cc
parenta22a339f8e044a1e8df011beb0b4c8f43792ac96 (diff)
downloadmariadb-git-30ebc3ee9efcab635b1f3e14b9198a58ae93c233.tar.gz
Add likely/unlikely to speed up execution
Added to: - if (error) - Lex - sql_yacc.yy and sql_yacc_ora.yy - In header files to alloc() calls - Added thd argument to thd_net_is_killed()
Diffstat (limited to 'sql/spatial.cc')
-rw-r--r--sql/spatial.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 255ba3f0647..a8a70d0763b 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -406,7 +406,7 @@ Geometry *Geometry::create_from_json(Geometry_buffer *buffer,
key_buf[key_len++]= (uchar)je->s.c_next | 0x20; /* make it lowercase. */
}
- if (je->s.error)
+ if (unlikely(je->s.error))
goto err_return;
if (key_len == type_keyname_len &&
@@ -1956,6 +1956,7 @@ bool Gis_multi_point::init_from_json(json_engine_t *je, bool er_on_3D,
if (je->s.error)
return TRUE;
+
if (n_points == 0)
{
je->s.error= Geometry::GEOJ_EMPTY_COORDINATES;
@@ -2231,6 +2232,7 @@ bool Gis_multi_line_string::init_from_json(json_engine_t *je, bool er_on_3D,
n_line_strings++;
}
+
if (je->s.error)
return TRUE;
@@ -2629,8 +2631,10 @@ bool Gis_multi_polygon::init_from_json(json_engine_t *je, bool er_on_3D,
n_polygons++;
}
+
if (je->s.error)
return TRUE;
+
if (n_polygons == 0)
{
je->s.error= Geometry::GEOJ_EMPTY_COORDINATES;