From 965cb9d28d183253eaa85e1764727ad40a5d0fe7 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 18 Jan 2019 12:20:59 -0500 Subject: [PATCH] elm_code: Pass data to status_type_get Summary: Every single call path has already dearly paid the price of pointer indirection so let's save a few million extra look-ups and just pass it along. ref T6209 Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T6209 Differential Revision: https://phab.enlightenment.org/D7692 --- src/lib/elementary/elm_code_widget.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c index 68738c10e0..39a1ee162e 100644 --- a/src/lib/elementary/elm_code_widget.c +++ b/src/lib/elementary/elm_code_widget.c @@ -152,12 +152,8 @@ _elm_code_widget_fill_line_token(Evas_Textgrid_Cell *cells, int count, int start } static unsigned int -_elm_code_widget_status_type_get(Elm_Code_Widget *widget, Elm_Code_Line *line, unsigned int col) +_elm_code_widget_status_type_get(Elm_Code_Widget_Data *pd, Elm_Code_Line *line, unsigned int col) { - Elm_Code_Widget_Data *pd; - - pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); - if (line->status != ELM_CODE_STATUS_TYPE_DEFAULT) return line->status; @@ -421,7 +417,7 @@ _elm_code_widget_fill_line(Elm_Code_Widget *widget, Elm_Code_Line *line) cells[x].codepoint = unichr; cells[x].bold = 0; cells[x].fg = ELM_CODE_TOKEN_TYPE_DEFAULT; - cells[x].bg = _elm_code_widget_status_type_get(widget, line, x - gutter + 1); + cells[x].bg = _elm_code_widget_status_type_get(pd, line, x - gutter + 1); charwidth = 1; if (unichr == '\t') @@ -429,7 +425,7 @@ _elm_code_widget_fill_line(Elm_Code_Widget *widget, Elm_Code_Line *line) for (i = x + 1; i < x + charwidth && i < (unsigned int) w; i++) { cells[i].codepoint = 0; - cells[i].bg = _elm_code_widget_status_type_get(widget, line, i - gutter + 1); + cells[i].bg = _elm_code_widget_status_type_get(pd, line, i - gutter + 1); } _elm_code_widget_fill_whitespace(widget, unichr, &cells[x]); @@ -438,7 +434,7 @@ _elm_code_widget_fill_line(Elm_Code_Widget *widget, Elm_Code_Line *line) { cells[x].codepoint = 0; cells[x].bold = 0; - cells[x].bg = _elm_code_widget_status_type_get(widget, line, x - gutter + 1); + cells[x].bg = _elm_code_widget_status_type_get(pd, line, x - gutter + 1); } _elm_code_widget_fill_line_gutter(widget, cells, w, line);