Fossil SCM
Slight optimization: Make two tables "static" that can be.
Commit
4440dae21237f861f08a5026c52a2ca44aff4ce3
Parent
8184f39d803f9ad…
1 file changed
+4
-4
+4
-4
| --- src/statrep.c | ||
| +++ src/statrep.c | ||
| @@ -673,11 +673,11 @@ | ||
| 673 | 673 | const char *zView = P("view"); /* Which view/report to show. */ |
| 674 | 674 | int eType = RPT_NONE; /* Numeric code for view/report to show */ |
| 675 | 675 | int i; /* Loop counter */ |
| 676 | 676 | const char *zUserName; /* Name of user */ |
| 677 | 677 | const char *azView[16]; /* Drop-down menu of view types */ |
| 678 | - const struct { | |
| 678 | + static const struct { | |
| 679 | 679 | const char *zName; /* Name of view= screen type */ |
| 680 | 680 | const char *zVal; /* Value of view= query parameter */ |
| 681 | 681 | int eType; /* Corresponding RPT_* define */ |
| 682 | 682 | } aViewType[] = { |
| 683 | 683 | { "File Changes","byfile", RPT_BYFILE }, |
| @@ -685,19 +685,19 @@ | ||
| 685 | 685 | { "By User", "byuser", RPT_BYUSER }, |
| 686 | 686 | { "By Week", "byweek", RPT_BYWEEK }, |
| 687 | 687 | { "By Weekday", "byweekday", RPT_BYWEEKDAY }, |
| 688 | 688 | { "By Year", "byyear", RPT_BYYEAR }, |
| 689 | 689 | }; |
| 690 | - const char *const azType[] = { | |
| 690 | + static const char *const azType[] = { | |
| 691 | 691 | "a", "All Changes", |
| 692 | 692 | "ci", "Check-ins", |
| 693 | 693 | "g", "Tags", |
| 694 | 694 | "e", "Tech Notes", |
| 695 | 695 | "t", "Tickets", |
| 696 | 696 | "w", "Wiki" |
| 697 | 697 | }; |
| 698 | - | |
| 698 | + | |
| 699 | 699 | login_check_credentials(); |
| 700 | 700 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 701 | 701 | zUserName = P("user"); |
| 702 | 702 | if( zUserName==0 ) zUserName = P("u"); |
| 703 | 703 | if( zUserName && zUserName[0]==0 ) zUserName = 0; |
| @@ -735,11 +735,11 @@ | ||
| 735 | 735 | } |
| 736 | 736 | style_submenu_element("Stats", "Stats", "%R/stat"); |
| 737 | 737 | url_reset(&url); |
| 738 | 738 | style_header("Activity Reports"); |
| 739 | 739 | switch( eType ){ |
| 740 | - case RPT_BYYEAR: | |
| 740 | + case RPT_BYYEAR: | |
| 741 | 741 | stats_report_by_month_year(0, 0, zUserName); |
| 742 | 742 | break; |
| 743 | 743 | case RPT_BYMONTH: |
| 744 | 744 | stats_report_by_month_year(1, 0, zUserName); |
| 745 | 745 | break; |
| 746 | 746 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -673,11 +673,11 @@ | |
| 673 | const char *zView = P("view"); /* Which view/report to show. */ |
| 674 | int eType = RPT_NONE; /* Numeric code for view/report to show */ |
| 675 | int i; /* Loop counter */ |
| 676 | const char *zUserName; /* Name of user */ |
| 677 | const char *azView[16]; /* Drop-down menu of view types */ |
| 678 | const struct { |
| 679 | const char *zName; /* Name of view= screen type */ |
| 680 | const char *zVal; /* Value of view= query parameter */ |
| 681 | int eType; /* Corresponding RPT_* define */ |
| 682 | } aViewType[] = { |
| 683 | { "File Changes","byfile", RPT_BYFILE }, |
| @@ -685,19 +685,19 @@ | |
| 685 | { "By User", "byuser", RPT_BYUSER }, |
| 686 | { "By Week", "byweek", RPT_BYWEEK }, |
| 687 | { "By Weekday", "byweekday", RPT_BYWEEKDAY }, |
| 688 | { "By Year", "byyear", RPT_BYYEAR }, |
| 689 | }; |
| 690 | const char *const azType[] = { |
| 691 | "a", "All Changes", |
| 692 | "ci", "Check-ins", |
| 693 | "g", "Tags", |
| 694 | "e", "Tech Notes", |
| 695 | "t", "Tickets", |
| 696 | "w", "Wiki" |
| 697 | }; |
| 698 | |
| 699 | login_check_credentials(); |
| 700 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 701 | zUserName = P("user"); |
| 702 | if( zUserName==0 ) zUserName = P("u"); |
| 703 | if( zUserName && zUserName[0]==0 ) zUserName = 0; |
| @@ -735,11 +735,11 @@ | |
| 735 | } |
| 736 | style_submenu_element("Stats", "Stats", "%R/stat"); |
| 737 | url_reset(&url); |
| 738 | style_header("Activity Reports"); |
| 739 | switch( eType ){ |
| 740 | case RPT_BYYEAR: |
| 741 | stats_report_by_month_year(0, 0, zUserName); |
| 742 | break; |
| 743 | case RPT_BYMONTH: |
| 744 | stats_report_by_month_year(1, 0, zUserName); |
| 745 | break; |
| 746 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -673,11 +673,11 @@ | |
| 673 | const char *zView = P("view"); /* Which view/report to show. */ |
| 674 | int eType = RPT_NONE; /* Numeric code for view/report to show */ |
| 675 | int i; /* Loop counter */ |
| 676 | const char *zUserName; /* Name of user */ |
| 677 | const char *azView[16]; /* Drop-down menu of view types */ |
| 678 | static const struct { |
| 679 | const char *zName; /* Name of view= screen type */ |
| 680 | const char *zVal; /* Value of view= query parameter */ |
| 681 | int eType; /* Corresponding RPT_* define */ |
| 682 | } aViewType[] = { |
| 683 | { "File Changes","byfile", RPT_BYFILE }, |
| @@ -685,19 +685,19 @@ | |
| 685 | { "By User", "byuser", RPT_BYUSER }, |
| 686 | { "By Week", "byweek", RPT_BYWEEK }, |
| 687 | { "By Weekday", "byweekday", RPT_BYWEEKDAY }, |
| 688 | { "By Year", "byyear", RPT_BYYEAR }, |
| 689 | }; |
| 690 | static const char *const azType[] = { |
| 691 | "a", "All Changes", |
| 692 | "ci", "Check-ins", |
| 693 | "g", "Tags", |
| 694 | "e", "Tech Notes", |
| 695 | "t", "Tickets", |
| 696 | "w", "Wiki" |
| 697 | }; |
| 698 | |
| 699 | login_check_credentials(); |
| 700 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 701 | zUserName = P("user"); |
| 702 | if( zUserName==0 ) zUserName = P("u"); |
| 703 | if( zUserName && zUserName[0]==0 ) zUserName = 0; |
| @@ -735,11 +735,11 @@ | |
| 735 | } |
| 736 | style_submenu_element("Stats", "Stats", "%R/stat"); |
| 737 | url_reset(&url); |
| 738 | style_header("Activity Reports"); |
| 739 | switch( eType ){ |
| 740 | case RPT_BYYEAR: |
| 741 | stats_report_by_month_year(0, 0, zUserName); |
| 742 | break; |
| 743 | case RPT_BYMONTH: |
| 744 | stats_report_by_month_year(1, 0, zUserName); |
| 745 | break; |
| 746 |