1- % % ``Licensed under the Apache License, Version 2.0 (the "License");
1+ % %
2+ % % %CopyrightBegin%
3+ % %
4+ % % SPDX-License-Identifier: Apache-2.0
5+ % %
6+ % % Copyright Ericsson AB 1996-2025. All Rights Reserved.
7+ % %
8+ % % Licensed under the Apache License, Version 2.0 (the "License");
29% % you may not use this file except in compliance with the License.
310% % You may obtain a copy of the License at
411% %
1017% % See the License for the specific language governing permissions and
1118% % limitations under the License.
1219% %
13- % % The Initial Developer of the Original Code is Ericsson Utvecklings AB.
14- % % Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
15- % % AB. All Rights Reserved.''
20+ % % %CopyrightEnd%
1621% %
17- % % $Id: mnesia_lib.erl,v 1.3 2009/07/01 15:45:40 kostis Exp $
18- % % This module contains all sorts of various which doesn't fit
19- % % anywhere else. Basically everything is exported.
20-
2122-module (mnesia_lib ).
2223
2324-include (" mnesia.hrl" ).
3031 add /2 ,
3132 add_list /2 ,
3233 all_nodes /0 ,
33- % % catch_val/1,
3434 cleanup_tmp_files /1 ,
3535 copy_file /2 ,
3636 copy_holders /1 ,
@@ -442,7 +442,7 @@ ensure_loaded(Appl) ->
442442
443443local_active_tables () ->
444444 Tabs = val ({schema , local_tables }),
445- lists :zf (fun (Tab ) -> active_here (Tab ) end , Tabs ).
445+ lists :filtermap (fun (Tab ) -> active_here (Tab ) end , Tabs ).
446446
447447active_tables () ->
448448 Tabs = val ({schema , tables }),
@@ -452,7 +452,7 @@ active_tables() ->
452452 _ -> {true , Tab }
453453 end
454454 end ,
455- lists :zf (F , Tabs ).
455+ lists :filtermap (F , Tabs ).
456456
457457etype (X ) when integer (X ) -> integer ;
458458etype ([]) -> nil ;
@@ -588,7 +588,7 @@ mkcore(CrashInfo) ->
588588 term_to_binary (Core ).
589589
590590procs () ->
591- Fun = fun (P ) -> {P , (catch lists :zf (fun proc_info /1 , process_info (P )))} end ,
591+ Fun = fun (P ) -> {P , (catch lists :filtermap (fun proc_info /1 , process_info (P )))} end ,
592592 lists :map (Fun , processes ()).
593593
594594proc_info ({registered_name , Val }) -> {true , Val };
@@ -626,7 +626,7 @@ relatives() ->
626626 Pid -> {true , {Name , Pid , catch process_info (Pid )}}
627627 end
628628 end ,
629- lists :zf (Info , mnesia :ms ()).
629+ lists :filtermap (Info , mnesia :ms ()).
630630
631631workers ({workers , Loader , Sender , Dumper }) ->
632632 Info = fun ({Name , Pid }) ->
@@ -635,7 +635,7 @@ workers({workers, Loader, Sender, Dumper}) ->
635635 Pid -> {true , {Name , Pid , catch process_info (Pid )}}
636636 end
637637 end ,
638- lists :zf (Info , [{loader , Loader }, {sender , Sender }, {dumper , Dumper }]).
638+ lists :filtermap (Info , [{loader , Loader }, {sender , Sender }, {dumper , Dumper }]).
639639
640640locking_procs (LockList ) when list (LockList ) ->
641641 Tids = [element (1 , Lock ) || Lock <- LockList ],
@@ -649,7 +649,7 @@ locking_procs(LockList) when list(LockList) ->
649649 false
650650 end
651651 end ,
652- lists :zf (Info , UT ).
652+ lists :filtermap (Info , UT ).
653653
654654view () ->
655655 Bin = mkcore ({crashinfo , {" view only~n " , []}}),
@@ -693,7 +693,7 @@ vcore() ->
693693 {ok , Cwd } = file :get_cwd (),
694694 case file :list_dir (Cwd ) of
695695 {ok , Files }->
696- CoreFiles = lists :sort (lists :zf (Filter , Files )),
696+ CoreFiles = lists :sort (lists :filtermap (Filter , Files )),
697697 show (" Mnesia core files: ~p~n " , [CoreFiles ]),
698698 vcore (lists :last (CoreFiles ));
699699 Error ->
0 commit comments