aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/buffer.c
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-04-26 18:28:49 +0200
committerGitHub <noreply@github.com>2023-04-26 18:28:49 +0200
commita1b045f60a22d366e255dfff1c54ed42ebe49284 (patch)
tree89965d1e8574a751b3c08c707a5ceece857b8521 /src/nvim/api/buffer.c
parent6674d706d97d7e681a5404f79a1c5bba3af80bae (diff)
downloadrneovim-a1b045f60a22d366e255dfff1c54ed42ebe49284.tar.gz
rneovim-a1b045f60a22d366e255dfff1c54ed42ebe49284.tar.bz2
rneovim-a1b045f60a22d366e255dfff1c54ed42ebe49284.zip
refactor(clang-tidy): remove redundant casts
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r--src/nvim/api/buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index ca3cf76388..10c684941c 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -404,7 +404,7 @@ void nvim_buf_set_lines(uint64_t channel_id, Buffer buffer, Integer start, Integ
// If the size of the range is reducing (ie, new_len < old_len) we
// need to delete some old_len. We do this at the start, by
// repeatedly deleting line "start".
- size_t to_delete = (new_len < old_len) ? (size_t)(old_len - new_len) : 0;
+ size_t to_delete = (new_len < old_len) ? old_len - new_len : 0;
for (size_t i = 0; i < to_delete; i++) {
if (ml_delete((linenr_T)start, false) == FAIL) {
api_set_error(err, kErrorTypeException, "Failed to delete line");
@@ -648,7 +648,7 @@ void nvim_buf_set_text(uint64_t channel_id, Buffer buffer, Integer start_row, In
// If the size of the range is reducing (ie, new_len < old_len) we
// need to delete some old_len. We do this at the start, by
// repeatedly deleting line "start".
- size_t to_delete = (new_len < old_len) ? (size_t)(old_len - new_len) : 0;
+ size_t to_delete = (new_len < old_len) ? old_len - new_len : 0;
for (size_t i = 0; i < to_delete; i++) {
if (ml_delete((linenr_T)start_row, false) == FAIL) {
api_set_error(err, kErrorTypeException, "Failed to delete line");