def reduce(self) -> None:
        """
        Remove redundant segments.

        Since this class is implemented based on list,
        this method may require O(n) time.
        """
        idx = 0
        while idx < len(self):
            if idx > 0 and \
                    self[idx - 1].type == 'text' and self[idx].type == 'text':
                self[idx - 1].data['text'] += self[idx].data['text']
                del self[idx]
            else:
                idx += 1
Remove redundant segments.

        Since this class is implemented based on list,
        this method may require O(n) time.