Drupal 8 has fewer items per page after using Unset

I delete elements by means of an undefined element in hook_views_post_execute, since the view is configured with 10 elements per page.

The problem is that it shows me sometimes 6 or 8, I looked for options but to reduce the size as when inserting programmed nodes and not when they are missing

/ **
* Implements hooks_views_post_execute ().
* /
function module_views_post_execute (ViewExecutable $ view) {

// Removes the rows by the user's origin from the region.
if ($ view-> id () == & taxonomy_term && $ view-> current_display == & # 39; page_1 & nbsp;) {
$ language =  Drupal :: languageManager () -> getCurrentLanguage () -> getId ();
foreach ($ view-> result as $ key => $ row) {
$ node = Node :: load ($ row -> _ entity-> id ());
$ region_user = $ node-> getOwner () -> field_region-> value;

if ($ language! = $ region_user) {
unset ($ view-> result[$key]) // delete a line
}
}
}
}

Code based on references to update the page:

/ **
* Implements hooks_views_pre_render ().
* /
function module_views_pre_render (ViewExecutable $ view) {

if ($ view-> id () == & taxonomy_term && $ view-> current_display == & # 39; page_1 & nbsp;) {

// Rebuild the number of items per page.
$ view-> pager-> total_items = $ view-> total_rows;
$ view-> pager-> updatePageInfo ();
}
}

Reference pages viewed:
Edit pager views programmatically

https://www.drupal.org/forum/support/module-development-and-code-questions/2017-10-10/update-views-result-and-pager-in-hook

https://www.drupal.org/project/views/issues/953072

Debugging $ view-> result after $ view-> pager-> updatePageInfo ();, can see that only 6 items and not 10

enter the description of the image here