Path 1: 16 calls (0.34)

Console (16)

-1 (16)

Style (16)

1def get_style_at_offset(self, console: "Console", offset: int) -> Style:
2        """Get the style of a character at give offset.
3
4        Args:
5            console (~Console): Console where text will be rendered.
6            offset (int): Offset in to text (negative indexing supported)
7
8        Returns:
9            Style: A Style instance.
10        """
11        # TODO: This is a little inefficient, it is only used by full justify
12        if offset < 0:
13            offset = len(self) + offset
14        get_style = console.get_style
15        style = get_style(self.style).copy()
16        for start, end, span_style in self._spans:
17            if end > offset >= start:
18                style += get_style(span_style, default="")
19        return style
            

Path 2: 15 calls (0.32)

Console (15)

0 (15)

Style (15)

1def get_style_at_offset(self, console: "Console", offset: int) -> Style:
2        """Get the style of a character at give offset.
3
4        Args:
5            console (~Console): Console where text will be rendered.
6            offset (int): Offset in to text (negative indexing supported)
7
8        Returns:
9            Style: A Style instance.
10        """
11        # TODO: This is a little inefficient, it is only used by full justify
12        if offset < 0:
13            offset = len(self) + offset
14        get_style = console.get_style
15        style = get_style(self.style).copy()
16        for start, end, span_style in self._spans:
17            if end > offset >= start:
18                style += get_style(span_style, default="")
19        return style
            

Path 3: 13 calls (0.28)

Console (13)

3 (5) 0 (3) 1 (2) 2 (2) 6 (1)

Style (13)

1def get_style_at_offset(self, console: "Console", offset: int) -> Style:
2        """Get the style of a character at give offset.
3
4        Args:
5            console (~Console): Console where text will be rendered.
6            offset (int): Offset in to text (negative indexing supported)
7
8        Returns:
9            Style: A Style instance.
10        """
11        # TODO: This is a little inefficient, it is only used by full justify
12        if offset < 0:
13            offset = len(self) + offset
14        get_style = console.get_style
15        style = get_style(self.style).copy()
16        for start, end, span_style in self._spans:
17            if end > offset >= start:
18                style += get_style(span_style, default="")
19        return style
            

Path 4: 3 calls (0.06)

Console (3)

0 (2) 3 (1)

Style (3)

1def get_style_at_offset(self, console: "Console", offset: int) -> Style:
2        """Get the style of a character at give offset.
3
4        Args:
5            console (~Console): Console where text will be rendered.
6            offset (int): Offset in to text (negative indexing supported)
7
8        Returns:
9            Style: A Style instance.
10        """
11        # TODO: This is a little inefficient, it is only used by full justify
12        if offset < 0:
13            offset = len(self) + offset
14        get_style = console.get_style
15        style = get_style(self.style).copy()
16        for start, end, span_style in self._spans:
17            if end > offset >= start:
18                style += get_style(span_style, default="")
19        return style