File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -528,20 +528,13 @@ public static void closeCommentRepliesFragments(@NonNull final FragmentActivity
528528 }
529529
530530 // Only pop back stack entries named CommentRepliesFragment.TAG if they are at the top.
531- while (true ) {
532- final int count = fm .getBackStackEntryCount ();
533- if (count == 0 ) {
534- break ;
535- }
536- final FragmentManager .BackStackEntry topEntry = fm .getBackStackEntryAt (count - 1 );
537- final String topName = topEntry .getName ();
538- if (CommentRepliesFragment .TAG .equals (topName )) {
539- // Safe to pop the topmost matching entry (it won't remove other unrelated entries)
540- fm .popBackStackImmediate (topName , FragmentManager .POP_BACK_STACK_INCLUSIVE );
541- } else {
542- break ;
543- }
531+ while (fm .getBackStackEntryCount () > 0
532+ && CommentRepliesFragment .TAG .equals (fm .getBackStackEntryAt (
533+ fm .getBackStackEntryCount () - 1 ).getName ())) {
534+ fm .popBackStackImmediate (CommentRepliesFragment .TAG ,
535+ FragmentManager .POP_BACK_STACK_INCLUSIVE );
544536 }
537+
545538 }
546539
547540 public static void openPlaylistFragment (final FragmentManager fragmentManager ,
You can’t perform that action at this time.
0 commit comments