Path 1: 1862 calls (0.98)

60 (607) 80 (124) 100 (91) 20 (89) 3 (84) 4 (81) 46 (70) 96 (69) 88 (55) 8 (49)

1def rstrip_end(self, size: int) -> None:
2        """Remove whitespace beyond a certain width at the end of the text.
3
4        Args:
5            size (int): The desired size of the text.
6        """
7        text_length = len(self)
8        if text_length > size:
9            excess = text_length - size
10            whitespace_match = _re_whitespace.search(self.plain)
11            if whitespace_match is not None:
12                whitespace_count = len(whitespace_match.group(0))
13                self.right_crop(min(whitespace_count, excess))
            

Path 2: 27 calls (0.01)

60 (6) 10 (3) 100 (3) 4 (3) 7 (3) 20 (2) 9 (1) 14 (1) 19 (1) 2 (1)

1def rstrip_end(self, size: int) -> None:
2        """Remove whitespace beyond a certain width at the end of the text.
3
4        Args:
5            size (int): The desired size of the text.
6        """
7        text_length = len(self)
8        if text_length > size:
9            excess = text_length - size
10            whitespace_match = _re_whitespace.search(self.plain)
11            if whitespace_match is not None:
12                whitespace_count = len(whitespace_match.group(0))
13                self.right_crop(min(whitespace_count, excess))
            

Path 3: 16 calls (0.01)

27 (4) 20 (3) 3 (3) 4 (3) 72 (1) 6 (1) 14 (1)

1def rstrip_end(self, size: int) -> None:
2        """Remove whitespace beyond a certain width at the end of the text.
3
4        Args:
5            size (int): The desired size of the text.
6        """
7        text_length = len(self)
8        if text_length > size:
9            excess = text_length - size
10            whitespace_match = _re_whitespace.search(self.plain)
11            if whitespace_match is not None:
12                whitespace_count = len(whitespace_match.group(0))
13                self.right_crop(min(whitespace_count, excess))