[vte] parser: Annotate unlikely conditionals



commit 3596fa22cfeff920c025380ed532c11003a3dcc2
Author: Christian Persch <chpe src gnome org>
Date:   Tue Mar 27 19:40:13 2018 +0200

    parser: Annotate unlikely conditionals

 src/parser.cc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/parser.cc b/src/parser.cc
index 7f746cf..6a3c32d 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -631,7 +631,7 @@ static int parser_osc_collect(struct vte_parser *parser, uint32_t raw)
          * Our state-machine already verifies those restrictions.
          */
 
-        if (!vte_seq_string_push(&parser->seq.arg_str, raw))
+        if (G_UNLIKELY(!vte_seq_string_push(&parser->seq.arg_str, raw)))
                 parser->state = STATE_ST_IGNORE;
 
         return VTE_SEQ_NONE;
@@ -671,7 +671,7 @@ static int parser_dcs_consume(struct vte_parser *parser, uint32_t raw)
 
 static int parser_dcs_collect(struct vte_parser *parser, uint32_t raw)
 {
-        if (!vte_seq_string_push(&parser->seq.arg_str, raw))
+        if (G_UNLIKELY(!vte_seq_string_push(&parser->seq.arg_str, raw)))
                 parser->state = STATE_DCS_IGNORE;
 
         return VTE_SEQ_NONE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]